amqplib: Set connection.client

This commit is contained in:
Ask Solem 2011-01-18 21:39:56 +01:00
parent aad945d3a5
commit 501669fed3
2 changed files with 4 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class SimpleBase(object):
self.buffer = deque() self.buffer = deque()
self.consumer.register_callback(self._receive) self.consumer.register_callback(self._receive)
def get(self, block=True, timeout=None, sync=False): def get(self, block=True, timeout=None):
if not block: if not block:
return self.get_nowait() return self.get_nowait()
self._consume() self._consume()

View File

@ -210,13 +210,15 @@ class Transport(base.Transport):
raise KeyError("Missing password for AMQP connection.") raise KeyError("Missing password for AMQP connection.")
if not conninfo.port: if not conninfo.port:
conninfo.port = self.default_port conninfo.port = self.default_port
return self.Connection(host=conninfo.host, conn = self.Connection(host=conninfo.host,
userid=conninfo.userid, userid=conninfo.userid,
password=conninfo.password, password=conninfo.password,
virtual_host=conninfo.virtual_host, virtual_host=conninfo.virtual_host,
insist=conninfo.insist, insist=conninfo.insist,
ssl=conninfo.ssl, ssl=conninfo.ssl,
connect_timeout=conninfo.connect_timeout) connect_timeout=conninfo.connect_timeout)
conn.client = self.client
return conn
def close_connection(self, connection): def close_connection(self, connection):
"""Close the AMQP broker connection.""" """Close the AMQP broker connection."""