PHP Class Kraken\Loop\Tick\TickContinousQueue

Show file Open project: kraken-php/framework Class Usage Examples

Protected Properties

Property Type Description
$loop Kraken\Loop\LoopModelInterface
$queue SplQueue

Public Methods

Method Description
__construct ( Kraken\Loop\LoopModelInterface $loop )
__destruct ( )
add ( callable $listener ) Add a callback to be invoked on the next tick of the event loop.
isEmpty ( ) : boolean Check if the next tick queue is empty.
tick ( ) Flush the callback queue.

Method Details

__construct() public method

public __construct ( Kraken\Loop\LoopModelInterface $loop )
$loop Kraken\Loop\LoopModelInterface

__destruct() public method

public __destruct ( )

add() public method

Callbacks are guaranteed to be executed in the order they are enqueued, before any timer or stream events.
public add ( callable $listener )
$listener callable

isEmpty() public method

Check if the next tick queue is empty.
public isEmpty ( ) : boolean
return boolean

tick() public method

Invokes callbacks which were on the queue when tick() was called and newly added ones.
public tick ( )

Property Details

$loop protected property

protected LoopModelInterface,Kraken\Loop $loop
return Kraken\Loop\LoopModelInterface

$queue protected property

protected SplQueue $queue
return SplQueue