pubsub.py 文件源码

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

项目:hitman-old 作者: tmacro 项目源码 文件源码
def _recv(self, noError = False,):
        if self._watched and not noError:
            raise RPCError('you cannot recieve on a watched connection')
        try:
            self._log.debug('waiting for incoming data')
            data = self._socket.recv_string()
            topic, msg = self._unpack_event(data)
        except zmq.ZMQError:
            return None
        except ValueError:
            raise RPCError('Malformed message body')
        self._log.debug('recieved event %s on topic:%s'%(self._event_id, topic))
        with open('test.txt', 'a') as f:
            f.write('%s %s\n'%(self._event_id, time.time()))
        self._event_id += 1
        return Event(topic, msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号