I am trying to create a WebSocket server using Tornado. I would like to execute a specific command that will send a message for each IOLoop cycle.
Make it clearer; let's say I have the following WebSocket handler
class MyHandler(websocket.WebSocketHandler):
def auto_loop(self, *args, **kwargs):
self.write_message('automatic message')
Is there a way to start auto_loopIOLoop in every loop without blocking the main thread?
I believe that for this I can use green ones, but I'm looking for a more Tornado-based solution.
thanks
Paris source
share