當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。