Methods summary
public
|
#
addReadStream( resource $stream, callable $listener )
Register a listener to be notified when a stream is ready to read.
Register a listener to be notified when a stream is ready to read.
Parameters
- $stream
resource $stream The PHP stream resource to check.
- $listener
callable $listener Invoked when the stream is ready.
|
public
|
#
addWriteStream( resource $stream, callable $listener )
Register a listener to be notified when a stream is ready to write.
Register a listener to be notified when a stream is ready to write.
Parameters
- $stream
resource $stream The PHP stream resource to check.
- $listener
callable $listener Invoked when the stream is ready.
|
public
|
#
removeReadStream( resource $stream )
Remove the read event listener for the given stream.
Remove the read event listener for the given stream.
Parameters
- $stream
resource $stream The PHP stream resource.
|
public
|
#
removeWriteStream( resource $stream )
Remove the write event listener for the given stream.
Remove the write event listener for the given stream.
Parameters
- $stream
resource $stream The PHP stream resource.
|
public
|
#
removeStream( resource $stream )
Remove all listeners for the given stream.
Remove all listeners for the given stream.
Parameters
- $stream
resource $stream The PHP stream resource.
|
public
React\EventLoop\Timer\TimerInterface
|
#
addTimer( integer|float $interval, callable $callback )
Enqueue a callback to be invoked once after the given interval.
Enqueue a callback to be invoked once after the given interval.
The execution order of timers scheduled to execute at the same time is not
guaranteed.
Parameters
- $interval
integer|float $interval The number of seconds to wait before execution.
- $callback
callable $callback The callback to invoke.
Returns
|
public
React\EventLoop\Timer\TimerInterface
|
#
addPeriodicTimer( integer|float $interval, callable $callback )
Enqueue a callback to be invoked repeatedly after the given interval.
Enqueue a callback to be invoked repeatedly after the given interval.
The execution order of timers scheduled to execute at the same time is not
guaranteed.
Parameters
- $interval
integer|float $interval The number of seconds to wait before execution.
- $callback
callable $callback The callback to invoke.
Returns
|
public
|
|
public
boolean
|
|
public
|
#
nextTick( callable $listener )
Schedule a callback to be invoked on the next tick of the event loop.
Schedule a callback to be invoked on the next tick of the event loop.
Callbacks are guaranteed to be executed in the order they are enqueued,
before any timer or stream events.
Parameters
- $listener
callable $listener The callback to invoke.
|
public
|
#
futureTick( callable $listener )
Schedule a callback to be invoked on a future tick of the event loop.
Schedule a callback to be invoked on a future tick of the event loop.
Callbacks are guaranteed to be executed in the order they are enqueued.
Parameters
- $listener
callable $listener The callback to invoke.
|
public
|
#
tick( )
Perform a single iteration of the event loop.
Perform a single iteration of the event loop.
|
public
|
#
run( )
Run the event loop until there are no more tasks to perform.
Run the event loop until there are no more tasks to perform.
|
public
|
#
stop( )
Instruct a running event loop to stop.
Instruct a running event loop to stop.
|