June 2017
Intermediate to advanced
536 pages
9h 49m
English
Without any of the suggested event loop extensions, React event loop defaults to the React\EventLoop\StreamSelectLoop class, which is a stream_select() function-based event loop.
The page at http://php.net/manual/en/function.stream-select.php states, The stream_select() function accepts arrays of streams and waits for them to change status
As we already saw in our previous examples, making an event loop in React is simple
<?phprequire_once __DIR__ . '/vendor/autoload.php';use \React\EventLoop\Factory;use \Rx\Scheduler;$loop = Factory::create();Scheduler::setDefaultFactory(function () use ($loop) { return new Scheduler\EventLoopScheduler($loop);});// Within the loop$loop->run();
We are using the Factory::create() static ...