-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
infinite loop #15
Comments
The You may also want to look into using v1.1 of this lib so that you can at least add a timeout to your (failing) function (#14). I hope this helps 👍 |
@clue if you try the If Other thing on
|
@edolix Can you be more specific in what exactly will block and/or provide a small gist to reproduce this? I'm well aware of how the EventLoop works. I wrote the documentation you're quoting. I think we agree that this project is not how most people should be using the EventLoop. That being said, it solves some use cases, including integrating a non-blocking HTTP client in a blocking execution environment as described in https://github.com/clue/reactphp-block#quickstart-example |
@clue take a look at this small App: it's faster then split all the files in gist. If you run the |
@edolix Your example seems to use two independent EventLoop interfaces. See https://github.com/ratchetphp/Pawl#example on how to explicitly pass the EventLoop to Pawl. If you're using the same EventLoop for attaching and waiting, this should work just fine 👍 |
@clue yep, but the |
ReactPHP has no concept of a "main" EventLoop. It is your responsibility to create an EventLoop instance once and then pass it around to your whole application. Pawl automatically uses a new loop internally if you don't pass one. This works just fine if this one connection is the only thing your want to do in your application. If you want to do anything else in your application, then you have to explicitly pass this loop instance so that it will be shared in your whole application. This should work just fine if you follow the last link 👍 |
It works but Pawel's EventLoop will be stopped by the first |
That's what I'm saying. You MUST use the same EventLoop for Pawl and your |
@clue i already tried and the problem is the WebSocket connection will be closed by reactphp-block/src/functions.php Line 69 in 2f516b2
App to reproduce with the same EventLoop to Pawel and Right after the second test... the script will exit. |
To better explain my main goal: have a long-live PHP script connected to a WebSocket and use this library where i need to |
@clue any thoughts or tips? |
@edolix It sounds like you may want to avoid blocking (awaiting) the script in the first place. I would suggest using a more event-driven approach and registering an event handler to the |
Yep, thank you! 👍 |
hello ,
I use guzzle library , react promise , block react. my problem is that the system loops infinitely when I call as following
the requestPromise as following:
So I cant find why system loops infinitely.
The text was updated successfully, but these errors were encountered: