Merge "Remove unuseful param of the ConnectionContext"
This commit is contained in:
commit
bc237be16e
oslo/messaging/_drivers
@ -107,16 +107,15 @@ class ConnectionContext(rpc_common.Connection):
|
|||||||
If possible the function makes sure to return a connection to the pool.
|
If possible the function makes sure to return a connection to the pool.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, conf, url, connection_pool, pooled=True):
|
def __init__(self, connection_pool, pooled=True):
|
||||||
"""Create a new connection, or get one from the pool."""
|
"""Create a new connection, or get one from the pool."""
|
||||||
self.connection = None
|
self.connection = None
|
||||||
self.conf = conf
|
|
||||||
self.url = url
|
|
||||||
self.connection_pool = connection_pool
|
self.connection_pool = connection_pool
|
||||||
if pooled:
|
if pooled:
|
||||||
self.connection = connection_pool.get()
|
self.connection = connection_pool.get()
|
||||||
else:
|
else:
|
||||||
self.connection = connection_pool.connection_cls(conf, url)
|
# a non-pooled connection is requested, so create a new connection
|
||||||
|
self.connection = connection_pool.create()
|
||||||
self.pooled = pooled
|
self.pooled = pooled
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
|
@ -330,9 +330,7 @@ class AMQPDriverBase(base.BaseDriver):
|
|||||||
return target.exchange or self._default_exchange
|
return target.exchange or self._default_exchange
|
||||||
|
|
||||||
def _get_connection(self, pooled=True):
|
def _get_connection(self, pooled=True):
|
||||||
return rpc_amqp.ConnectionContext(self.conf,
|
return rpc_amqp.ConnectionContext(self._connection_pool,
|
||||||
self._url,
|
|
||||||
self._connection_pool,
|
|
||||||
pooled=pooled)
|
pooled=pooled)
|
||||||
|
|
||||||
def _get_reply_q(self):
|
def _get_reply_q(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user