Event callbacks
If a callback is registered for an event, it will be called when the event becomes active. To associate a callback with event one can pass a callable to either Event::__construct, or Event::set, or one of the factory methods like Event::timer.
If a callback is registered for an event, it will be called when the event becomes active. To associate a callback with event one can pass a callable to either Event::__construct, or Event::set, or one of the factory methods like Event::timer.
An event callback should match the following prototype:
fdThe file descriptor, stream resource or socket associated with the event. For signal event
fdis equal to the signal number.whatBit mask of all events triggered.
argUser custom data.
Event::timer expects the callback to match the following prototype:
argUser custom data.
Event::signal expects the callback to match the following prototype:
signumThe number of the triggered signal(e.g.
SIGTERM).argUser custom data.