A remote procedure call (rpc) abstraction.
Invoke a remote method that returns something.
Parameters: |
|
---|---|
Returns: | A dict from the remote method. |
Raises : | openstack.common.rpc.common.Timeout if a complete response is not received before the timeout is reached. |
Invoke a remote method that does not return anything.
Parameters: |
|
---|---|
Returns: | None |
Invoke a remote method that does not return anything.
Parameters: |
|
---|---|
Returns: | None |
Clean up resoruces in use by implementation.
Clean up any resources that have been allocated by the RPC implementation. This is typically open connections to a messaging service. This function would get called before an application using this API exits to allow connections to get torn down cleanly.
Returns: | None |
---|
Create a connection to the message bus used for rpc.
For some example usage of creating a connection and some consumers on that connection, see nova.service.
Parameters: | new – Whether or not to create a new connection. A new connection will be created by default. If new is False, the implementation is free to return an existing connection from a pool. |
---|---|
Returns: | An instance of openstack.common.rpc.common.Connection |
Broadcast a remote method invocation with no return.
This method will get invoked on all consumers that were set up with this topic name and fanout=True.
Parameters: |
|
---|---|
Returns: | None |
Broadcast to a remote method invocation with no return.
Parameters: |
|
---|---|
Returns: | None |
Invoke a remote method and get back an iterator.
In this case, the remote method will be returning multiple values in separate messages, so the return values can be processed as the come in via an iterator.
Parameters: |
|
---|---|
Returns: | An iterator. The iterator will yield a tuple (N, X) where N is an index that starts at 0 and increases by one for each value returned and X is the Nth value that was returned by the remote method. |
Raises : | openstack.common.rpc.common.Timeout if a complete response is not received before the timeout is reached. |
Send notification event.
Parameters: |
|
---|---|
Returns: | None |
Get a queue name for a given topic + host.
This function only works if this naming convention is followed on the consumer side, as well. For example, in nova, every instance of the nova-foo service calls create_consumer() for two topics:
foo foo.<host>
Messages sent to the ‘foo’ topic are distributed to exactly one instance of the nova-foo service. The services are chosen in a round-robin fashion. Messages sent to the ‘foo.<host>’ topic are sent to the nova-foo service on <host>.