correlationid_center.py 文件源码

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

项目:Python_Study 作者: thsheep 项目源码 文件源码
def request(self, n):
        corr_id = str(uuid.uuid4())
        self.response[corr_id] = None

        #???????????????correlation_id
        self.channel.basic_publish(exchange='',
                             routing_key='compute_queue',
                             properties=pika.BasicProperties(
                               reply_to = self.callback_queue,
                               correlation_id = corr_id,
                                         ),
                 body=str(n))
        #???????
        while self.response[corr_id] is None:
            self.connection.process_data_events()
        return int(self.response[corr_id])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号