From 9d299a5f3e528fcc41e8942df300facaeaf5c437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Tue, 5 Dec 2017 18:37:20 +0100 Subject: [PATCH] Use subscribe method from super, instead of using duplicated code --- src/event_handlers/stateful_event_handler.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/event_handlers/stateful_event_handler.py b/src/event_handlers/stateful_event_handler.py index f03e105..211a139 100644 --- a/src/event_handlers/stateful_event_handler.py +++ b/src/event_handlers/stateful_event_handler.py @@ -26,9 +26,7 @@ class StatefulEventHandler(EventHandlerBase): except StopIteration: self.reset() return - if response_anchor not in self.subscriptions: - self.subscriptions.add(response_anchor) - self.zmq_sub_socket.setsockopt_string(zmq.SUBSCRIBE, response_anchor) + self.subscribe(response_anchor) response_data = json.dumps({ 'anchor': response_anchor, 'data': response_data,