Move ioloop init to module level

This commit is contained in:
Bálint Bokros 2018-01-25 15:24:01 +01:00
parent 7e4f8ae2f9
commit 6246baa675

View File

@ -6,10 +6,11 @@ from zmq.eventloop.zmqstream import ZMQStream
from config import PUBLISHER_PORT, RECEIVER_PORT
ioloop.install()
class Messaging:
def __init__(self):
ioloop.install()
self._zmq_context = zmq.Context.instance()
self._zmq_sub_socket = self._zmq_context.socket(zmq.SUB)
self._zmq_sub_socket.connect('tcp://localhost:{}'.format(PUBLISHER_PORT))