public function executeAll(...$args)
    {
        if ($this->isEmpty()) {
            return 0;
        }

        $n = 0;
        do {
            if ($cb = $this->shift()) {
                $cb(...$args);
                ++$n;
                if ($cb instanceof CallbackWrapper) {
                    $cb->cancel();
                }
            }
        } while (!$this->isEmpty());
        return $n;
    }