publisher.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:napalm-logs 作者: napalm-automation 项目源码 文件源码
def _setup_ipc(self):
        '''
        Subscribe to the pub IPC
        and publish the messages
        on the right transport.
        '''
        self.ctx = zmq.Context()
        log.debug('Setting up the publisher puller')
        self.sub = self.ctx.socket(zmq.PULL)
        self.sub.bind(PUB_IPC_URL)
        try:
            self.sub.setsockopt(zmq.HWM, self.opts['hwm'])
            # zmq 2
        except AttributeError:
            # zmq 3
            self.sub.setsockopt(zmq.RCVHWM, self.opts['hwm'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号