Pass the driver instance to the listener instead of config
There are a couple of cases where having the driver instance is a good thing for the Listener, though, I would like to use the connection management as motivation here: Instead of creating a new connection for every Listener it would be possible to let the driver instance managing the whole connect / reconnect and session handling process. In the old implementation, when a reconnect happens, the connection instance calls every consumer and sets the new connection / session to them. See: http://github.com/openstack/oslo-incubator/blob/master/openstack/common/rpc/impl_qpid.py#L368 Listeners can access the config instance through the driver instance.
This commit is contained in:
parent
fb67f72375
commit
3a910e8f72
|
@ -20,8 +20,8 @@ class Listener(object):
|
|||
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
def __init__(self, conf, target):
|
||||
self.conf = conf
|
||||
def __init__(self, driver, target):
|
||||
self.driver = driver
|
||||
self.target = target
|
||||
|
||||
@abc.abstractmethod
|
||||
|
|
Loading…
Reference in New Issue