apmec.common.rpc
Module¶apmec.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)
Parameters: |
|
---|
set_max_timeout
(max_timeout)¶Set RPC timeout ceiling for all backing-off RPC clients.
apmec.common.rpc.
Connection
¶Bases: object
close
()¶consume_in_threads
()¶create_consumer
(topic, endpoints, fanout=False, exchange='apmec', host=None)¶apmec.common.rpc.
RequestContextSerializer
(base=None)¶Bases: oslo_messaging.serializer.Serializer
convert RPC common context int apmec Context.
deserialize_context
(ctxt)¶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.
Parameters: |
|
---|---|
Returns: | Deserialized form of entity |
serialize_context
(ctxt)¶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.
Parameters: |
|
---|---|
Returns: | Serialized form of entity |
apmec.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
()¶Start a service.
stop
()¶Stop a service.
Parameters: | graceful – indicates whether to wait for all threads to finish or terminate them instantly |
---|
apmec.common.rpc.
VoidConnection
¶Bases: object
close
()¶consume_in_threads
()¶create_consumer
(topic, endpoints, fanout=False, exchange='apmec', host=None)¶apmec.common.rpc.
add_extra_exmods
(*args)¶apmec.common.rpc.
cleanup
()¶apmec.common.rpc.
clear_extra_exmods
()¶apmec.common.rpc.
create_connection
()¶apmec.common.rpc.
get_allowed_exmods
()¶apmec.common.rpc.
get_client
(target, version_cap=None, serializer=None)¶apmec.common.rpc.
get_notifier
(service=None, host=None, publisher_id=None)¶apmec.common.rpc.
get_server
(target, endpoints, serializer=None)¶apmec.common.rpc.
init
(conf)¶apmec.common.rpc.
init_action_rpc
(conf)¶Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.