-
-
Notifications
You must be signed in to change notification settings - Fork 50
Emit events on blocking operations #176
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
Comments
@EligiusSantori Welcome to this library! If I understand your problem correctly, then there should be no need for any additional events. Each Redis command follows request-response semantics as described in https://github.com/clue/reactphp-redis#commands. This means that either of your commands has to be used in a loop (or using async callbacks) and each invocation returns exactly one piece of data (or a I hope this helps! 👍 If so, consider supporting this project, for example by becoming a sponsor ❤️ |
Do you absolutely sure that interpreter optimizes recursion over promises there? There is 3 ways to implement it and none of them is robust enough.
Anyway, emitting |
Don't get me wrong, we can definitely theorize hypothetical problems all day. You seem to imply there's some kind of potential problem with the existing approach or some future potential development, perhaps you can help me understand what problem you're seeing exactly? You can already use If you want to learn more about the roadmap for future ReactPHP v3, you may want to check out https://github.com/orgs/reactphp/discussions/481. |
Please propagate
DuplexStreamInterface::on('data')
as normal event not just a promise.Promises are only fit when you need to do a single call.
When you need a
BLPOP
/XREAD
/XREADGROUP
-based endless reading loop, event is a must have.I think you can use command name as an event name so user will be able to choose what to handle.
The text was updated successfully, but these errors were encountered: