Add an example usage of RPCClient retry parameter
Change-Id: Ib88870b312721deff0d9b6db2ba2e3cb99da6038
This commit is contained in:
parent
948c05417c
commit
2cdf9ec5ff
@ -246,6 +246,18 @@ class RPCClient(object):
|
||||
|
||||
but this is probably only useful in limited circumstances as a wrapper
|
||||
class will usually help to make the code much more obvious.
|
||||
|
||||
By default, cast() and call() will block until the message is successfully
|
||||
sent. However, the retry parameter can be used to have message sending
|
||||
fail with a MessageDeliveryFailure after the given number of retries. For
|
||||
example::
|
||||
|
||||
client = messaging.RPCClient(transport, target, retry=None)
|
||||
client.call(ctxt, 'sync')
|
||||
try:
|
||||
client.prepare(retry=0).cast(ctxt, 'ping')
|
||||
except messaging.MessageDeliveryFailure:
|
||||
LOG.error("Failed to send ping message")
|
||||
"""
|
||||
|
||||
def __init__(self, transport, target,
|
||||
|
Loading…
x
Reference in New Issue
Block a user