-
Notifications
You must be signed in to change notification settings - Fork 60
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
Back-to-back event receiving with gevent #47
Comments
I dug into this a bit more. There seem to be a couple issues doing on here:
elif recv_event.is_set():
recv_event.clear()
try:
message = True
while message:
message = uwsgi.websocket_recv_nb()
recv_queue.put(message)
listening = spawn(listener, client)
except IOError:
client.connected = False It ends up writing an empty message for every event, but better than the alternatives. |
That seems like a nice solution, would you like to send a PR? |
I will; it may be a couple days. |
Created #48 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm seeing a problem with receiving multiple events in v0.5.2. I have a browser that sends multiple events. However, flask-uwsgi-websocket only reads 1 event every
timeout
seconds (30, in my case). I believe the problem is two-fold:The above can be cleaned up quite a bit. I also suspect that it is safe to reset the clear() flag before we finish reading all the current events. However, I rearranged it for testing purposes and I haven't gone back and verified that theory.
The text was updated successfully, but these errors were encountered: