Ejemplo n.º 1
0
 def open(self):
     """
     Open a connection to the broker.
     """
     if self.is_open():
         # already open
         return
     connector = Connector.find(self.url)
     domain = self.ssl_domain(connector)
     log.info('open: %s', connector)
     self._impl = BlockingConnection(connector.url.canonical,
                                     ssl_domain=domain)
     log.info('opened: %s', self.url)
Ejemplo n.º 2
0
 def open(self):
     """
     Open a connection to the broker.
     """
     if self.is_open():
         # already open
         return
     connector = Connector.find(self.url)
     domain = self.ssl_domain(connector)
     log.info('open: %s', connector)
     self._impl = BlockingConnection(
         connector.url.canonical,
         heartbeat=connector.heartbeat,
         ssl_domain=domain)
     log.info('opened: %s', self.url)
Ejemplo n.º 3
0
 def open(self):
     """
     Open a connection to the broker.
     """
     if self.is_open():
         # already open
         return
     connector = Connector.find(self.url)
     host = ':'.join((connector.host, utf8(connector.port)))
     virtual_host = connector.virtual_host or VIRTUAL_HOST
     domain = self.ssl_domain(connector)
     userid = connector.userid or USERID
     password = connector.password or PASSWORD
     log.info('open: %s', connector)
     self._impl = RealConnection(host=host,
                                 virtual_host=virtual_host,
                                 ssl=domain,
                                 userid=userid,
                                 password=password,
                                 confirm_publish=True)
     log.info('opened: %s', self.url)
Ejemplo n.º 4
0
 def open(self):
     """
     Open a connection to the broker.
     """
     if self.is_open():
         # already open
         return
     connector = Connector.find(self.url)
     Connection.add_transports()
     domain = self.ssl_domain(connector)
     log.info('open: %s', connector)
     impl = RealConnection(host=connector.host,
                           port=connector.port,
                           tcp_nodelay=True,
                           transport=connector.url.scheme,
                           username=connector.userid,
                           password=connector.password,
                           heartbeat=10,
                           **domain)
     impl.open()
     self._impl = impl
     log.info('opened: %s', self.url)
Ejemplo n.º 5
0
 def open(self):
     """
     Open a connection to the broker.
     """
     if self.is_open():
         # already open
         return
     connector = Connector.find(self.url)
     host = ':'.join((connector.host, utf8(connector.port)))
     virtual_host = connector.virtual_host or VIRTUAL_HOST
     domain = self.ssl_domain(connector)
     userid = connector.userid or USERID
     password = connector.password or PASSWORD
     log.info('open: %s', connector)
     self._impl = RealConnection(
         host=host,
         virtual_host=virtual_host,
         ssl=domain,
         userid=userid,
         password=password,
         confirm_publish=True)
     log.info('opened: %s', self.url)
Ejemplo n.º 6
0
 def open(self):
     """
     Open a connection to the broker.
     """
     if self.is_open():
         # already open
         return
     connector = Connector.find(self.url)
     Connection.add_transports()
     domain = self.ssl_domain(connector)
     log.info('open: %s', connector)
     impl = RealConnection(
         host=connector.host,
         port=connector.port,
         tcp_nodelay=True,
         transport=connector.url.scheme,
         username=connector.userid,
         password=connector.password,
         heartbeat=10,
         **domain)
     impl.open()
     self._impl = impl
     log.info('opened: %s', self.url)
Ejemplo n.º 7
0
 def test_find(self, find):
     url = 'amqp://localhost'
     found = Connector.find(url)
     find.assert_called_once_with(URL(url).canonical)
     self.assertEqual(found, find.return_value)
Ejemplo n.º 8
0
 def test_find(self, find):
     url = 'amqp://localhost'
     found = Connector.find(url)
     find.assert_called_once_with(URL(url).canonical)
     self.assertEqual(found, find.return_value)