def connect(self):
if self.connecting:
print('PikaClient: Already connecting to RabbitMQ')
return
print('PikaClient: Connecting to RabbitMQ on localhost:5672, Object: %s' % (self,))
self.connecting = True
# credentials = pika.PlainCredentials('guest', 'guest')
# param = pika.ConnectionParameters(host='localhost',
# port=5672,
# virtual_host="/"
# credentials=credentials
# )
param = pika.ConnectionParameters("localhost")
self.connection = TornadoConnection(param,
on_open_callback=self.on_connected)
#Currently this will close tornado ioloop.
#self.connection.add_on_close_callback(self.on_closed)
评论列表
文章目录