messaging.py 文件源码

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

项目:sawtooth-core 作者: hyperledger 项目源码 文件源码
def start(self):
        """Starts receiving messages on the underlying socket and passes them
        to the message router.
        """
        self._is_running = True

        while self._is_running:
            try:
                zmq_msg = await self._socket.recv_multipart()

                message = Message()
                message.ParseFromString(zmq_msg[-1])

                await self._msg_router.route_msg(message)
            except DecodeError as e:
                LOGGER.warning('Unable to decode: %s', e)
            except zmq.ZMQError as e:
                LOGGER.warning('Unable to receive: %s', e)
                return
            except asyncio.CancelledError:
                self._is_running = False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号