Class ExponentialBackoffPolicy (2.21.0)

Implement a simple exponential backoff policy.

Constructors

ExponentialBackoffPolicy(internal::RPCPolicyParameters)

Parameter
NameDescription
defaults internal::RPCPolicyParameters

ExponentialBackoffPolicy(std::chrono::duration< Rep1, Period1 >, std::chrono::duration< Rep2, Period2 >)

Parameters
NameDescription
initial_delay std::chrono::duration< Rep1, Period1 >
maximum_delay std::chrono::duration< Rep2, Period2 >
typename Rep1
typename Period1
typename Rep2
typename Period2

Functions

virtual clone() const

Return a new copy of this object.

Typically implemented as ```cpp return std::unique_ptr


Returns
TypeDescription
std::unique_ptr< RPCBackoffPolicy >

virtual Setup(grpc::ClientContext &) const

Update the ClientContext for the next call.

Parameter
NameDescription
context grpc::ClientContext &
Returns
TypeDescription
void

virtual OnCompletion(Status const &)

Return the delay after an RPC operation has completed.

Parameter
NameDescription
status Status const &

the status returned by the last RPC operation.

Returns
TypeDescription
std::chrono::milliseconds

true the delay before trying the operation again.

virtual OnCompletion(grpc::Status const &)

Parameter
NameDescription
status grpc::Status const &
Returns
TypeDescription
std::chrono::milliseconds

OnCompletion()

Returns
TypeDescription
std::chrono::milliseconds