[openstack-dev] [oslo][messaging]: some questions on the 'driver' API
gsim at redhat.com
Mon Dec 2 14:16:05 UTC 2013
The BaseDriver - which I take to be the API that must be fulfilled by
any transport implementation - has a listen() method taking a target,
but no way to stop listening on that specific target.
Is this because there is no need to ever cancel a subscription?
There is a cleanup() method on the BaseDriver and the Transport object
that contains it. However if more than one Transport object exists (e.g.
because there are more than one Targets) then they will share the same
driver, so calling cleanup on one would affect them all.
On the topic of relationship between Transport (and therefore RPCClient)
and driver instances, it would be nice if there was some more explicit
association. For example, some transport mechanisms may require some
setup for sending to each distinct address, and would perhaps want to
avoid doing that on every individual call. They could of course cache
their own context against the target instance. However it seems like it
might be generally useful for drivers to be aware of the lifecycle of
the different Transports or RPCClient instances that use them (it might
help inform other caching or pooling choices for example).
This is admittedly coming from a very limited understanding of the
anticipated use cases, and perhaps assuming it is a more general purpose
rpc mechanism than is actually intended.
More information about the OpenStack-dev