Shared code between AMQP based openstack.common.rpc implementations.
The code in this module is shared between the rpc implemenations based on AMQP.
Specifically, this includes impl_kombu and impl_qpid. impl_carrot also uses
AMQP, but is deprecated and predates this code.
-
class heat.openstack.common.rpc.amqp.CallbackWrapper(conf, callback, connection_pool)[source]
Bases: heat.openstack.common.rpc.amqp._ThreadPoolWithWait
Wraps a straight callback to allow it to be invoked in a green
thread.
-
class heat.openstack.common.rpc.amqp.ConnectionContext(conf, connection_pool, pooled=True, server_params=None)[source]
Bases: heat.openstack.common.rpc.common.Connection
The class that is actually returned to the caller of
create_connection(). This is essentially a wrapper around
Connection that supports ‘with’. It can also return a new
Connection, or one from a pool. The function will also catch
when an instance of this class is to be deleted. With that
we can return Connections to the pool on exceptions and so
forth without making the caller be responsible for catching
them. If possible the function makes sure to return a
connection to the pool.
-
close()[source]
Caller is done with this connection.
-
consume_in_thread()[source]
-
create_consumer(topic, proxy, fanout=False)[source]
-
create_worker(topic, proxy, pool_name)[source]
-
join_consumer_pool(callback, pool_name, topic, exchange_name)[source]
-
class heat.openstack.common.rpc.amqp.MulticallProxyWaiter(conf, msg_id, timeout, connection_pool)[source]
Bases: object
-
done()[source]
-
put(data)[source]
-
class heat.openstack.common.rpc.amqp.MulticallWaiter(conf, connection, timeout)[source]
Bases: object
-
done()[source]
-
class heat.openstack.common.rpc.amqp.Pool(conf, connection_cls, *args, **kwargs)[source]
Bases: eventlet.pools.Pool
Class that implements a Pool of Connections.
-
create()[source]
-
empty()[source]
-
class heat.openstack.common.rpc.amqp.ProxyCallback(conf, proxy, connection_pool)[source]
Bases: heat.openstack.common.rpc.amqp._ThreadPoolWithWait
Calls methods on a proxy object based on method and args.
-
class heat.openstack.common.rpc.amqp.ReplyProxy(conf, connection_pool)[source]
Bases: heat.openstack.common.rpc.amqp.ConnectionContext
Connection class for RPC replies / callbacks
-
add_call_waiter(waiter, msg_id)[source]
-
del_call_waiter(msg_id)[source]
-
get_reply_q()[source]
-
class heat.openstack.common.rpc.amqp.RpcContext(**kwargs)[source]
Bases: heat.openstack.common.rpc.common.CommonRpcContext
Context that supports replying to a rpc.call
-
deepcopy()[source]
-
reply(reply=None, failure=None, ending=False, connection_pool=None, log_failure=True)[source]
-
heat.openstack.common.rpc.amqp.call(conf, context, topic, msg, timeout, connection_pool)[source]
Sends a message on a topic and wait for a response.
-
heat.openstack.common.rpc.amqp.cast(conf, context, topic, msg, connection_pool)[source]
Sends a message on a topic without waiting for a response.
-
heat.openstack.common.rpc.amqp.cast_to_server(conf, context, server_params, topic, msg, connection_pool)[source]
Sends a message on a topic to a specific server.
-
heat.openstack.common.rpc.amqp.cleanup(connection_pool)[source]
-
heat.openstack.common.rpc.amqp.create_connection(conf, new, connection_pool)[source]
Create a connection
-
heat.openstack.common.rpc.amqp.fanout_cast(conf, context, topic, msg, connection_pool)[source]
Sends a message on a fanout exchange without waiting for a response.
-
heat.openstack.common.rpc.amqp.fanout_cast_to_server(conf, context, server_params, topic, msg, connection_pool)[source]
Sends a message on a fanout exchange to a specific server.
-
heat.openstack.common.rpc.amqp.get_connection_pool(conf, connection_cls)[source]
-
heat.openstack.common.rpc.amqp.get_control_exchange(conf)[source]
-
heat.openstack.common.rpc.amqp.msg_reply(conf, msg_id, reply_q, connection_pool, reply=None, failure=None, ending=False, log_failure=True)[source]
Sends a reply or an error on the channel signified by msg_id.
Failure should be a sys.exc_info() tuple.
-
heat.openstack.common.rpc.amqp.multicall(conf, context, topic, msg, timeout, connection_pool)[source]
Make a call that returns multiple times.
-
heat.openstack.common.rpc.amqp.notify(conf, context, topic, msg, connection_pool, envelope)[source]
Sends a notification event on a topic.
-
heat.openstack.common.rpc.amqp.pack_context(msg, context)[source]
Pack context into msg.
Values for message keys need to be less than 255 chars, so we pull
context out into a bunch of separate keys. If we want to support
more arguments in rabbit messages, we may want to do the same
for args at some point.
-
heat.openstack.common.rpc.amqp.unpack_context(conf, msg)[source]
Unpack context from msg.