xpika.py 文件源码

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

项目:landport 作者: land-pack 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号