Slide 78
Slide 78 text
Event loop
Implementors
- Reactor pattern (hence the name)
- start timers
- once
- periodic
- ticks
- wait for stream resources to become
- readable
- writable
78
$loop->addTimer(0.5, function () {
echo ‘world’;
});
$loop->addTimer(0.3, function () {
echo ‘hello’;
});
$loop->addReadStream($stream, $fn);
$loop->addWriteStream($stream, $fn);