promises
promises copied to clipboard
Event loop integration makes bad recommendation
It suggests the following as event loop integration for ReactPHP:
$loop = React\EventLoop\Factory::create();
$loop->addPeriodicTimer(0, [$queue, 'run']);
That will basically be an infinite loop that always calls [$queue, 'run'] and hogs the CPU until the entire thing is done. A better way would be a short timer like 10 milliseconds. It's not as responsive, but at least it doesn't consume 100% CPU.
Can you create a PR?
No, sorry. I don't have enough time currently.