Broadcasting a message using Tornado
问题 I have an app sending messages which should be broadcasted to every currently connected client. Lets say the clients count could go in thousands. How do I achieve this broadcasting logic without blocking? Sample code that I think will block: clients = [] class Broadcaster(tornado.websocket.WebSocketHandler): def on_message(self, message): for client in clients: self.write_message(message) Every example I found on the web was like the above code. There were some examples using @gen.coroutine