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:
Flaper Fesp 2013-05-06 20:54:12 +02:00
parent fb67f72375
commit 3a910e8f72
1 changed files with 2 additions and 2 deletions

View File

@ -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