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