The nova.openstack.common.rpc.amqp Module

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 CallbackWrapper(conf, callback, connection_pool)

Bases: nova.openstack.common.rpc.amqp._ThreadPoolWithWait

Wraps a straight callback to allow it to be invoked in a green thread.

class ConnectionContext(conf, connection_pool, pooled=True, server_params=None)

Bases: nova.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()

Caller is done with this connection.

consume_in_thread()
create_consumer(topic, proxy, fanout=False)
create_worker(topic, proxy, pool_name)
join_consumer_pool(callback, pool_name, topic, exchange_name)
class MulticallProxyWaiter(conf, msg_id, timeout, connection_pool)

Bases: object

done()
put(data)
class MulticallWaiter(conf, connection, timeout)

Bases: object

done()
class Pool(conf, connection_cls, *args, **kwargs)

Bases: eventlet.pools.Pool

Class that implements a Pool of Connections.

create()
empty()
class ProxyCallback(conf, proxy, connection_pool)

Bases: nova.openstack.common.rpc.amqp._ThreadPoolWithWait

Calls methods on a proxy object based on method and args.

class ReplyProxy(conf, connection_pool)

Bases: nova.openstack.common.rpc.amqp.ConnectionContext

Connection class for RPC replies / callbacks

add_call_waiter(waiter, msg_id)
del_call_waiter(msg_id)
get_reply_q()
class RpcContext(**kwargs)

Bases: nova.openstack.common.rpc.common.CommonRpcContext

Context that supports replying to a rpc.call

deepcopy()
reply(reply=None, failure=None, ending=False, connection_pool=None, log_failure=True)
call(conf, context, topic, msg, timeout, connection_pool)

Sends a message on a topic and wait for a response.

cast(conf, context, topic, msg, connection_pool)

Sends a message on a topic without waiting for a response.

cast_to_server(conf, context, server_params, topic, msg, connection_pool)

Sends a message on a topic to a specific server.

cleanup(connection_pool)
create_connection(conf, new, connection_pool)

Create a connection

fanout_cast(conf, context, topic, msg, connection_pool)

Sends a message on a fanout exchange without waiting for a response.

fanout_cast_to_server(conf, context, server_params, topic, msg, connection_pool)

Sends a message on a fanout exchange to a specific server.

get_connection_pool(conf, connection_cls)
get_control_exchange(conf)
msg_reply(conf, msg_id, reply_q, connection_pool, reply=None, failure=None, ending=False, log_failure=True)

Sends a reply or an error on the channel signified by msg_id.

Failure should be a sys.exc_info() tuple.

multicall(conf, context, topic, msg, timeout, connection_pool)

Make a call that returns multiple times.

notify(conf, context, topic, msg, connection_pool, envelope)

Sends a notification event on a topic.

pack_context(msg, context)

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.

unpack_context(conf, msg)

Unpack context from msg.

Previous topic

The nova.openstack.common.rootwrap.wrapper Module

Next topic

The nova.openstack.common.rpc.common Module

This Page