promises icon indicating copy to clipboard operation
promises copied to clipboard

Event loop integration makes bad recommendation

Open kelunik opened this issue 8 years ago • 2 comments

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.

kelunik avatar Dec 21 '17 12:12 kelunik

Can you create a PR?

Tobion avatar Feb 12 '20 01:02 Tobion

No, sorry. I don't have enough time currently.

kelunik avatar Feb 12 '20 08:02 kelunik