messaging.py 文件源码

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

项目:sawtooth-core 作者: hyperledger 项目源码 文件源码
def send(self, message_type, message_content, timeout=None):
        correlation_id = uuid.uuid4().hex

        self._msg_router.expect_reply(correlation_id)

        message = Message(
            correlation_id=correlation_id,
            content=message_content,
            message_type=message_type)

        try:
            await self._socket.send_multipart([message.SerializeToString()])
        except asyncio.CancelledError:
            raise

        return await self._msg_router.await_reply(correlation_id,
                                                  timeout=timeout)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号