def __init__(self, xpub="tcp://127.0.0.1:8990",
xsub="tcp://127.0.0.1:8989"):
self.log = logging.getLogger("{module}.{name}".format(
module=self.__class__.__module__, name=self.__class__.__name__))
super(Broker, self).__init__()
self.running = False
self.xpub_url = xpub
self.xsub_url = xsub
self.ctx = zmq.Context()
self.xpub = self.ctx.socket(zmq.XPUB)
self.xpub.bind(self.xpub_url)
self.xsub = self.ctx.socket(zmq.XSUB)
self.xsub.bind(self.xsub_url)
# self.proxy = zmq.proxy(xpub, xsub)
评论列表
文章目录