mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 23:31:31 +00:00
Refactor of ZMQWebsocketHandler callback (closure -> method)
This commit is contained in:
parent
863cc304ad
commit
8ee658e62a
@ -14,13 +14,12 @@ class ZMQWebSocketHandler(WebSocketHandler):
|
|||||||
|
|
||||||
def open(self, *args, **kwargs):
|
def open(self, *args, **kwargs):
|
||||||
logging.debug('WebSocket connection initiated')
|
logging.debug('WebSocket connection initiated')
|
||||||
|
event_handler_connector.register_callback(self.zmq_callback)
|
||||||
|
|
||||||
def zmq_callback(msg_parts):
|
def zmq_callback(self, msg_parts):
|
||||||
anchor, data = msg_parts
|
anchor, data = msg_parts
|
||||||
logging.debug('Received on pull socket: {}'.format(data.decode()))
|
logging.debug('Received on pull socket: {}'.format(data.decode()))
|
||||||
self.write_message(data.decode())
|
self.write_message(data.decode())
|
||||||
|
|
||||||
event_handler_connector.register_callback(zmq_callback)
|
|
||||||
|
|
||||||
def on_message(self, message):
|
def on_message(self, message):
|
||||||
logging.debug('Received on WebSocket: {}'.format(message))
|
logging.debug('Received on WebSocket: {}'.format(message))
|
||||||
|
Loading…
Reference in New Issue
Block a user