tacker.common.rpc module

tacker.common.rpc module

class tacker.common.rpc.BackingOffClient(transport, target, timeout=None, version_cap=None, serializer=None, retry=None, call_monitor_timeout=None)

Bases: oslo_messaging.rpc.client.RPCClient

An oslo messaging RPC Client that implements a timeout backoff.

This has all of the same interfaces as oslo_messaging.RPCClient but if the timeout parameter is not specified, the _ContextWrapper returned will track when call timeout exceptions occur and exponentially increase the timeout for the given call method.

prepare(*args, **kwargs)

Prepare a method invocation context.

Use this method to override client properties for an individual method invocation. For example:

def test(self, ctxt, arg):
    cctxt = self.prepare(version='2.5')
    return cctxt.call(ctxt, 'test', arg=arg)
  • exchange (str) – see Target.exchange
  • topic (str) – see Target.topic
  • namespace (str) – see Target.namespace
  • version (str) – requirement the server must support, see Target.version
  • server (str) – send to a specific server, see Target.server
  • fanout (bool) – send to all servers on topic, see Target.fanout
  • timeout (int or float) – an optional default timeout (in seconds) for call()s
  • version_cap (str) – raise a RPCVersionCapError version exceeds this cap
  • retry (int) – an optional connection retries configuration: None or -1 means to retry forever. 0 means no retry is attempted. N means attempt at most N retries.
  • call_monitor_timeout (int) – an optional timeout (in seconds) for active call heartbeating. If specified, requires the server to heartbeat long-running calls at this interval (less than the overall timeout parameter).
static set_max_timeout(max_timeout)

Set RPC timeout ceiling for all backing-off RPC clients.

class tacker.common.rpc.Connection

Bases: object

create_consumer(topic, endpoints, fanout=False, exchange='tacker', host=None)
class tacker.common.rpc.RequestContextSerializer(base=None)

Bases: oslo_messaging.serializer.Serializer

convert RPC common context int tacker Context.


Deserialize a dictionary into a request context.

Parameters:ctxt – Request context dictionary
Returns:Deserialized form of entity
deserialize_entity(ctxt, entity)

Deserialize something from primitive form.

  • ctxt – Request context, in deserialized form
  • entity – Primitive to be deserialized

Deserialized form of entity


Serialize a request context into a dictionary.

Parameters:ctxt – Request context
Returns:Serialized form of context
serialize_entity(ctxt, entity)

Serialize something to primitive form.

  • ctxt – Request context, in deserialized form
  • entity – Entity to be serialized

Serialized form of entity

class tacker.common.rpc.Service(host, topic, manager=None, serializer=None)

Bases: oslo_service.service.Service

Service object for binaries running on hosts.

A service enables rpc by listening to queues based on topic and host.


Start a service.


Stop a service.

Parameters:graceful – indicates whether to wait for all threads to finish or terminate them instantly
class tacker.common.rpc.VoidConnection

Bases: object

create_consumer(topic, endpoints, fanout=False, exchange='tacker', host=None)
tacker.common.rpc.get_client(target, version_cap=None, serializer=None)
tacker.common.rpc.get_notifier(service=None, host=None, publisher_id=None)
tacker.common.rpc.get_server(target, endpoints, serializer=None)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.