Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event loop integration makes bad recommendation #86

Open
kelunik opened this issue Dec 21, 2017 · 2 comments
Open

Event loop integration makes bad recommendation #86

kelunik opened this issue Dec 21, 2017 · 2 comments

Comments

@kelunik
Copy link

kelunik commented Dec 21, 2017

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.

@Tobion
Copy link
Member

Tobion commented Feb 12, 2020

Can you create a PR?

@kelunik
Copy link
Author

kelunik commented Feb 12, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants