mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 23:51:32 +00:00
Hotfix eventhandlers invoked several times. Waiting for server refactor.
This commit is contained in:
parent
08260f70fa
commit
849fd7b61c
@ -21,3 +21,6 @@ class FSMBase:
|
|||||||
|
|
||||||
def subscribe_message_handler(self, msghandler):
|
def subscribe_message_handler(self, msghandler):
|
||||||
self.message_handlers.append(msghandler)
|
self.message_handlers.append(msghandler)
|
||||||
|
|
||||||
|
def unsubscribe_message_handler(self, msghandler):
|
||||||
|
self.message_handlers.remove(msghandler)
|
||||||
|
@ -49,6 +49,9 @@ class FSMManagingSocketHandler(ZMQWebSocketHandler):
|
|||||||
FSMManagingSocketHandler.fsm = FSM()
|
FSMManagingSocketHandler.fsm = FSM()
|
||||||
self.fsm.subscribe_message_handler(self.handle_fsm_message)
|
self.fsm.subscribe_message_handler(self.handle_fsm_message)
|
||||||
|
|
||||||
|
def on_close(self):
|
||||||
|
self.fsm.unsubscribe_message_handler(self.handle_fsm_message)
|
||||||
|
|
||||||
def handle_fsm_message(self, message):
|
def handle_fsm_message(self, message):
|
||||||
self._event_handler_connector.send_message(message)
|
self._event_handler_connector.send_message(message)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user