Use subscribe method from super, instead of using duplicated code

This commit is contained in:
Bálint Bokros 2017-12-05 18:37:20 +01:00
parent 92394cac27
commit 9d299a5f3e

View File

@ -26,9 +26,7 @@ class StatefulEventHandler(EventHandlerBase):
except StopIteration: except StopIteration:
self.reset() self.reset()
return return
if response_anchor not in self.subscriptions: self.subscribe(response_anchor)
self.subscriptions.add(response_anchor)
self.zmq_sub_socket.setsockopt_string(zmq.SUBSCRIBE, response_anchor)
response_data = json.dumps({ response_data = json.dumps({
'anchor': response_anchor, 'anchor': response_anchor,
'data': response_data, 'data': response_data,