From 3a910e8f72c2ef71792beb6c051c914ee4ae883a Mon Sep 17 00:00:00 2001 From: Flaper Fesp Date: Mon, 6 May 2013 20:54:12 +0200 Subject: [PATCH] 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. --- openstack/common/messaging/drivers/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openstack/common/messaging/drivers/base.py b/openstack/common/messaging/drivers/base.py index a6148cdda..eddfde2b2 100644 --- a/openstack/common/messaging/drivers/base.py +++ b/openstack/common/messaging/drivers/base.py @@ -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