14 instance()->setTimeout($cb, $timeout);
30 return instance()->setInterval($cb, $timeout);
42 instance()->clearInterval($intervalId);
An exception for terminatinating execution or to throw for unit testing.
A simple eventloop implementation.
$stream
PHP stream implementation.
addWriteStream($stream, callable $cb)
Adds a write stream.
removeWriteStream($stream)
Stop watching a stream for writes.
tick($block=false)
Executes all pending events.
stop()
Stops a running eventloop.
setInterval(callable $cb, $timeout)
Executes a function every x seconds.
setTimeout(callable $cb, $timeout)
Executes a function after x seconds.
removeReadStream($stream)
Stop watching a stream for reads.
clearInterval($intervalId)
Stops a running internval.
nextTick(callable $cb)
Runs a function immediately at the next iteration of the loop.
instance(Loop $newLoop=null)
Retrieves or sets the global Loop object.
addReadStream($stream, callable $cb)
Adds a read stream.