pubsub.py 文件源码

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

项目:rabbitChat 作者: anirbanroydas 项目源码 文件源码
def connect(self):
        """This method connects to RabbitMQ via the Torando Connectoin Adapter, returning the 
        connection handle.

        When the connection is established, the on_connection_open method
        will be invoked by pika.

        :rtype: pika.SelectConnection

        """

        pi('connect')

        if self._connecting:
            print 'RabbitMQClient: Already connecting to RabbitMQ'
            return

        print 'RabbitMQClient: Connecting to RabbitMQ on localhost:5672, Object: %s' % (self,)
        self._connecting = True

        pp(self, 'CONNECT')

        return pika.adapters.TornadoConnection(parameters=self._parameters,
                                               on_open_callback=self.on_connection_opened,
                                               stop_ioloop_on_close=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号