summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/impl_zmq.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2013-03-30 01:05:12 -0400
committerRussell Bryant <rbryant@redhat.com>2013-04-12 10:42:50 -0400
commit6901a3ba3e09ae091480b650ec23c2f2d9543152 (patch)
tree34062944991e1611b1f66965da7f1870fc1589fd /openstack/common/rpc/impl_zmq.py
parent9dcf688ea80f52cdb5413514198b2aa81d5a4e09 (diff)
downloadoslo-6901a3ba3e09ae091480b650ec23c2f2d9543152.tar.gz
oslo-6901a3ba3e09ae091480b650ec23c2f2d9543152.tar.xz
oslo-6901a3ba3e09ae091480b650ec23c2f2d9543152.zip
Add rpc method namespace support.
RPC endpoints already had the ability to expose multiple APIs ... sort of. You could pass multiple callback objects to the dispatcher and it would check all of them for a method call. This patch adds the ability to set a namespace on a callback object. This makes exposing multiple APIs a bit more like you would expect it to work. You can invoke a method on a specific callback object, as opposed to having it check all of them for the method. This will allow you to create, manage, and version APIs without any potential conflicts with other APIs being exposed by the same endpoint. An example of where I would like to use this is in Nova, where we have some methods that we would like to expose on *all* rpc endpoints. This includes no public API changes and is fully backwards compatible. Implement blueprint rpc-multi-api. Change-Id: Ief4433e2e1c32cfb05b4cd27b87fe32b40f4341d
Diffstat (limited to 'openstack/common/rpc/impl_zmq.py')
-rw-r--r--openstack/common/rpc/impl_zmq.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py
index 3fe45f5..fe880c0 100644
--- a/openstack/common/rpc/impl_zmq.py
+++ b/openstack/common/rpc/impl_zmq.py
@@ -276,7 +276,8 @@ class InternalContext(object):
try:
result = proxy.dispatch(
- ctx, data['version'], data['method'], **data['args'])
+ ctx, data['version'], data['method'],
+ data.get('namespace'), **data['args'])
return ConsumerBase.normalize_reply(result, ctx.replies)
except greenlet.GreenletExit:
# ignore these since they are just from shutdowns
@@ -351,7 +352,7 @@ class ConsumerBase(object):
return
proxy.dispatch(ctx, data['version'],
- data['method'], **data['args'])
+ data['method'], data.get('namespace'), **data['args'])
class ZmqBaseReactor(ConsumerBase):