-
Notifications
You must be signed in to change notification settings - Fork 106
[0.6.x] Optional loop instance to client #180
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
Conversation
@tomas-novotny What's the use case here? There should be only one event loop, but if it's unit tests, we might as well make the connector configurable. |
In some our application we have (mostly from historical reasons) greater control over This helps mostly in unit-tests but even in some low-level libraries with optional It works fine most of the time, but if dependencies are in wrong order two Configurable connector is also a solution, but if this package does not want to communicate usage of Loop, it's just fine and i don't have problem with that. |
So the ReactPHP project itself is moving the global Loop accessor, we've made the loop arguments for most if not all classes optional. And I'm following what we're doing there but skipping the optional step. So injecting through the Connector has the preference. However...:
Oof that is rough, those are really shitty to track down. That does make this PR a bit more complicated. Because, aside for being side tracked and not responding ealier, sorry for that, I was going to ask if you wanted to make the changes or if you wanted me to do that. There are 4 places where the global loop accessor is used in the Have you tested this change in your situation and does it solve the issues you're seeing? Here are the two options we have IMHO:
|
Like this or would you prefer to add it to |
Going to add it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again as always for your great work!
@tomas-novotny Just merged #181 and #182, will take the first alpha some time next week. Let me know if you ran into issues with your tests. |
Make possible to set custom
LoopInterface
instance into newly createdClient
.