Google Cloud C++ Client
2.7.0
C++ Client Library for Google Cloud Platform
|
Construct a polling policy from existing Retry and Backoff policies. More...
#include <google/cloud/polling_policy.h>
Public Member Functions | |
GenericPollingPolicy (Retry retry_policy, Backoff backoff_policy) | |
std::unique_ptr< PollingPolicy > | clone () const override |
Return a copy of the current policy. More... | |
bool | OnFailure (Status const &status) override |
A callback to indicate that a polling attempt failed. More... | |
std::chrono::milliseconds | WaitPeriod () override |
How long should the polling loop wait before trying again. More... | |
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.
Retry | the retry policy used to limit the number of errors or the total duration of the polling loop. |
Backoff | the backoff policy used to control how often the library polls. |
Definition at line 94 of file polling_policy.h.
|
inline |
Definition at line 96 of file polling_policy.h.
|
inlineoverridevirtual |
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.
Implements google::cloud::PollingPolicy.
Definition at line 102 of file polling_policy.h.
|
inlineoverridevirtual |
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".
Implements google::cloud::PollingPolicy.
Definition at line 108 of file polling_policy.h.
|
inlineoverridevirtual |
How long should the polling loop wait before trying again.
Implements google::cloud::PollingPolicy.
Definition at line 112 of file polling_policy.h.