-
Notifications
You must be signed in to change notification settings - Fork 104
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
ReactPHP without Promises #92
Comments
What's your goal, what are you trying to achieve? You can, but you'd be limited.
The Sync Client uses a very simple event loop internally. |
I guess I'm struggling with the whole approach to Promises; it's not very OO as far as I can see. Our code will run in a docker container and only need to pick up 1 message at a time. Our concurrency comes from multiple copies of the container, not the need to asynchronously pick multiple messages off the queue and process them as and when each part can progress. I love the idea of ReactPHP though, with it's robust event loop, and I was wondering why the choice had been made not to use it in the synchronous client as well. I guess it doesn't really matter? |
Promises are a confusing concept at first, since they are a push mechanic the Since you are processing one message at a time it shouldn't matter for you. Picking up messages and processing non-blocking only makes sense if either your operation is non-blocking, or you are handling them in threads/child processes. Not sure why @jakubkulhan decided to do that, but might have a look at using it in the sync client as well |
The initial idea was to be able to split sync and async clients in different packages, so the sync client wouldn't need to depend on ReactPHP. However, I never got to do that :) If you want to use ReactPHP, I suggest you use the async client. |
That makes sense to be honest, what might be interesting to consider is to use the |
Do you have any idea how I could implement a ReactPHP EventLoop without having to use the asynchronous promises?
Is there any reason why your normal Client doesn't use a ReactPHP EventLoop?
The text was updated successfully, but these errors were encountered: