def __init__(self, call_queue_name="wisp"):
self._call_queue_name = call_queue_name
self._connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
self._publish_channel = self._connection.channel()
self._publish_channel.queue_declare(queue=self._call_queue_name)
self._receive_channel = self._connection.channel()
result = self._receive_channel.queue_declare(exclusive=True)
self._receive_queue_name = result.method.queue
self._consuming_thread = threading.Thread(target=self.start_consuming,
args=(self._receive_channel,
self._receive_queue_name,
self.on_response))
self._consuming_thread.start()
评论列表
文章目录