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

[1.x] Prevents blocking event loop #195

Merged
merged 1 commit into from
May 24, 2024
Merged

[1.x] Prevents blocking event loop #195

merged 1 commit into from
May 24, 2024

Conversation

l3aro
Copy link
Contributor

@l3aro l3aro commented May 13, 2024

ReactPHP runs in one thread and can't be interrupted. So, when we have some blocking stuff inside one of the handlers, for example connection to Redis not stable, or turn on xDebug make garbage collector slower than usual, the whole loop is blocked, and all other handlers will be delayed!

@taylorotwell taylorotwell requested a review from joedixon May 13, 2024 16:59
@taylorotwell taylorotwell marked this pull request as draft May 13, 2024 16:59
@joedixon
Copy link
Collaborator

Hey @l3aro thanks for the suggestion. The PR looks good, I just want to find some time to give it a full test at some decent scale and will report back when I've had the opportunity to do so.

@joedixon
Copy link
Collaborator

Tested and working great. Nice addtion, thank you!

@joedixon joedixon marked this pull request as ready for review May 24, 2024 10:54
@joedixon joedixon changed the title Prevent blocking stuff [1.x] Prevents blocking event loop May 24, 2024
@taylorotwell taylorotwell merged commit 2eb9c55 into laravel:main May 24, 2024
11 checks passed
@ging-dev
Copy link
Contributor

@l3aro @joedixon async(callable():(PromiseInterface<T>|T) $function): (callable():PromiseInterface<T>) only makes sense if the callback uses the await(PromiseInterface<T> $promise): T. See: https://github.com/reactphp/async?tab=readme-ov-file#async. Looks like this commit uses async() incorrectly.

ging-dev added a commit to ging-dev/reverb that referenced this pull request May 30, 2024
@ging-dev ging-dev mentioned this pull request May 30, 2024
taylorotwell pushed a commit that referenced this pull request May 31, 2024
* Revert #195

* make async dev dependency

---------

Co-authored-by: Joe Dixon <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants