Class GenericPollingPolicy<Retry, Backoff> (2.11.0)

Construct a polling policy from existing Retry and Backoff policies.

A polling policy can be built by composing a retry and backoff policy. For example, to create a polling policy that "retries N times, waiting a fixed period between retries" you could compose the "try N times" retry policy with the "wait a fixed period between retries" backoff policy.

This class makes it easier to create such composed polling policies.


GenericPollingPolicy(Retry, Backoff)

Name Description
retry_policy Retry
backoff_policy Backoff


virtual clone() const

Return a copy of the current policy.

This function is called at the beginning of the polling loop. Policies that are based on relative time should restart their timers when this function is called.

Type Description
std::unique_ptr< PollingPolicy >

virtual OnFailure(Status const &)

A callback to indicate that a polling attempt failed.

This is called when a polling request fails. Note that this callback is not invoked when the polling request succeeds with "operation not done".

Name Description
status Status const &
Type Description

true if the failure should be treated as transient and the polling loop should continue.

virtual WaitPeriod()

How long should the polling loop wait before trying again.

Type Description