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

[RFC] Global Loop (simplified) #82

Closed
wants to merge 2 commits into from

Conversation

jsor
Copy link
Member

@jsor jsor commented Mar 11, 2017

This is a simplified alternative to #77 introducing a global loop on top of the current API and being backward compatible.

To use the global loop, Factory::create() can be simply replaced by GlobalLoop::get().

The global loop is run automatically in a shutdown function, so no need to call run() manually. This behaviour can be disabled by calling GlobalLoop::disableRunOnShutdown() or by simply calling GlobalLoop::get()->run() .

This incorporates the suggestion from @mbonneau (#77 (comment)) and also addresses #77 (comment).

@jsor jsor mentioned this pull request Mar 11, 2017
@WyriHaximus
Copy link
Member

I'm in favour of this, I think it's a great step in the right direction 👍

@mbonneau
Copy link

Would the plan be to have the react libraries to start using GlobalLoop::get() if a loop was not provided by the user?

@jsor
Copy link
Member Author

jsor commented Mar 17, 2017

@mbonneau i'm not sure i'd like an optional loop parameter. I'd prefer simple facade api's on top of the current api's, eg. something i proposed in #77 or @clue in reactphp-legacy/socket-client#38 and reactphp/reactphp#330 which then use the global loop.

@jsor jsor added this to the v1.0.0 milestone Apr 25, 2017
@jsor jsor force-pushed the global-loop-class branch from 6c6c6e9 to e7c6f27 Compare April 25, 2017 12:23
@jsor jsor force-pushed the global-loop-class branch from e7c6f27 to 4d5e850 Compare April 25, 2017 18:06
WyriHaximus added a commit to php-api-clients/pusher that referenced this pull request May 24, 2017
@clue clue removed this from the v1.0.0 milestone Apr 5, 2018
@justinwilaby
Copy link

justinwilaby commented Mar 6, 2019

It's been 2 years since this PR was created and it seems to be approved. Are there still plans to adopt this?

@WyriHaximus
Copy link
Member

Closing this as it has been resolved through #226 and follow up PR's

@WyriHaximus WyriHaximus closed this Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants