Amp\Internal\WhenQueue::__invoke PHP Method

__invoke() public method

Calls each callback in the queue, passing the provided values to the function.
public __invoke ( Throwable | null $exception, mixed $value )
$exception Throwable | null
$value mixed
    public function __invoke($exception, $value)
    {
        foreach ($this->queue as $callback) {
            try {
                $callback($exception, $value);
            } catch (\Throwable $exception) {
                Loop::defer(static function () use($exception) {
                    throw $exception;
                });
            }
        }
    }