Kraken\Event\BaseEventEmitterTrait::delay PHP Method

delay() public method

See also: EventEmitterInterface::delay
public delay ( $event, $ticks, callable $listener )
$listener callable
    public function delay($event, $ticks, callable $listener)
    {
        $counter = 0;
        return $this->on($event, function () use(&$counter, $event, $ticks, $listener) {
            if (++$counter >= $ticks) {
                call_user_func_array($listener, func_get_args());
            }
        });
    }