def send(self, message):
self.response = None
self.corr_id = str(uuid.uuid4())
self.channel.basic_publish(exchange='',
routing_key = 'eagle',
properties = pika.BasicProperties(\
reply_to = self.callback_queue,
correlation_id =self.corr_id,),
body=message
)
for i in xrange(self.timeout):
if self.response is None:
self.connection.process_data_events()
else:
break
time.sleep(1)
return self.response
评论列表
文章目录