-
Notifications
You must be signed in to change notification settings - Fork 111
Description
Hi all,
I am using tornadio2 from the GIT repository, b463209
I recently dicovered a problem in the way heartbeats are handled by Tornadio.
Incoming messages go through the on_message method of the TornadioWebSocketHandler class (in persistent.py). This entry point is used both by Socket.IO events and heartbeat frames. If the connection gets suddenly flooded —in a perfectly valid use-case—, Tornadio doesn't process the heartbeat frames anymore, because they are queued far behind all the other messages.
I implemented my server using a top-half / bottom-half pattern, but it is not enough, and the connection keeps getting closed although everything is working fine.
I have one solution, but you must know I am no Python expert. :)
Tornadio should first read messages as fast as possible to immediately read heartbeat frames. Event processing can be delayed to another worker. Basically, this is implementing the top-half / bottom-half logic in Tornadio itself.
What do you think? There might be a better idea. I am willing to help if needed.
Thanks,