当前位置: 首页>>代码示例>>Python>>正文


Python adapters.BaseConnection类代码示例

本文整理汇总了Python中pika.adapters.BaseConnection的典型用法代码示例。如果您正苦于以下问题:Python BaseConnection类的具体用法?Python BaseConnection怎么用?Python BaseConnection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BaseConnection类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: close

 def close(self, code=200, text='Normal shutdown'):
     BaseConnection.close(self, code, text)
     while self.is_open:
         try:
             self.process_data_events()
         except AMQPConnectionError:
             break
开发者ID:KnightBaron,项目名称:pika,代码行数:7,代码来源:blocking_connection.py

示例2: _adapter_connect

    def _adapter_connect(self, host, port):

        BaseConnection._adapter_connect(self, host, port)
        self.socket.setblocking(1)
        self.socket.settimeout(SOCKET_TIMEOUT)
        self._socket_timeouts = 0
        self._on_connected()
        while not self.is_open:
            self._flush_outbound()
            self._handle_read()
        return self
开发者ID:samuel,项目名称:pika,代码行数:11,代码来源:blocking_connection.py

示例3: _adapter_connect

 def _adapter_connect(self):
     BaseConnection._adapter_connect(self)
     self.socket.setblocking(1)
     # Set the timeout for reading/writing on the socket
     self.socket.settimeout(SOCKET_TIMEOUT)
     self._socket_timeouts = 0
     self._on_connected()
     while not self.is_open:
         self._flush_outbound()
         self._handle_read()
     return self
开发者ID:jazinga,项目名称:pika,代码行数:11,代码来源:blocking_connection.py

示例4: _adapter_connect

    def _adapter_connect(self):
        BaseConnection._adapter_connect(self)
        self.socket.setblocking(1)
        # Set the timeout for reading/writing on the socket
        self.socket.settimeout(self.parameters.socket_timeout)
        self._socket_timeouts = 0
        self._on_connected()
        self._timeouts = dict()

        # When using a high availability cluster (such as HAProxy) we are always able to connect
        # even though there might be no RabbitMQ backend.
        socket_timeout_retries = 0
        while not self.is_open and socket_timeout_retries<SOCKET_TIMEOUT_THRESHOLD:
            self._flush_outbound()
            self._handle_read()
            socket_timeout_retries +=1

        if not self.is_open:
            raise AMQPConnectionError("No connection could be opened after %s retries" % SOCKET_TIMEOUT_THRESHOLD)

        return self
开发者ID:Navisite,项目名称:pika,代码行数:21,代码来源:blocking_connection.py

示例5: __init__

 def __init__(self, parameters=None, reconnection_strategy=None):
     BaseConnection.__init__(self, parameters, None, reconnection_strategy)
开发者ID:KnightBaron,项目名称:pika,代码行数:2,代码来源:blocking_connection.py

示例6: __init__

 def __init__(self, parameters=None, reconnection_strategy=None):
     self._timeouts = dict()
     BaseConnection.__init__(self, parameters, None, reconnection_strategy)
开发者ID:jazinga,项目名称:pika,代码行数:3,代码来源:blocking_connection.py

示例7: __init__

 def __init__(self, parameters=None, reconnection_strategy=None):
     BaseConnection.__init__(self, parameters, None, reconnection_strategy)
     
     for h in log.logger.handlers:
         log.debug('pika handlers: %s' % h)
开发者ID:tfrench,项目名称:pika,代码行数:5,代码来源:blocking_connection.py


注:本文中的pika.adapters.BaseConnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。