-
Notifications
You must be signed in to change notification settings - Fork 12
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
Non-blocking socket reading #12
Comments
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions. |
I think that a non-blocking read is a nice feature. Listening for the |
Thank you for your reply. I can refactor the The method can't always be non-blocking because it should wait for the first message from WebSocket on handshake in Additionally, the current implementation waits for a 5 sec timeout for the first message. I can optimize it and return the message as soon as possible so the app will start much faster. |
Exactly.
We don't need to change the original method behavior, we just need to make them share the parts of the code that are identical in both. Just o prevent code duplication since blocking vs non blocking will have just a few different lines.
In which line did you see this? |
Well, I can't reproduce it now with the original method. Maybe I saw this in one of my implementations with I will write a few tests for the original method to have more info about its behavior and then try refactoring it. |
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions. |
In the (not yet released) 1.7 branch, \Wrench\Client has a new |
Great! That may work. I busy these days at work, try to look at this on weekends. |
Thanks for adding |
I am trying to fix the bug in
chrome-php/chrome
withDom
class, described in this issue. I need ability to read events from the socket without blocking execution. But I not sure should I refactor existing code or add new method.I prepared required changes here and here
The text was updated successfully, but these errors were encountered: