Fix ZMQWebSocketHandlers handling their own little FSM instances

This commit is contained in:
Kristóf Tóth 2018-02-05 14:10:21 +01:00
parent 96762575ba
commit 654a732368

View File

@ -44,9 +44,12 @@ class ZMQWebSocketHandler(WebSocketHandler):
class FSMManagingSocketHandler(ZMQWebSocketHandler):
fsm = None
def __init__(self, FSM, application, request, **kwargs):
super().__init__(application, request, **kwargs)
self.fsm = FSM()
if self.fsm is None:
FSMManagingSocketHandler.fsm = FSM()
self.fsm.subscribe_message_handler(self.handle_fsm_message)
def handle_fsm_message(self, message):