Source code for supriya.tools.webguitools.WebSocketHandler

# -*- encoding: utf-8 -*-
import tornado.websocket


[docs]class WebSocketHandler(tornado.websocket.WebSocketHandler):
[docs] def get_compression_options(self): return {}
[docs] def open(self): self.application.watchers.add(self) print('OPENED')
[docs] def on_close(self): self.application.watchers.remove(self) print('CLOSED')
[docs] def on_message(self, message): pass
[docs] def update(self, topic, event): try: event = event.copy() event['topic'] = topic self.write_message(event) except: pass