Google Cloud C++ Client  1.32.1
C++ Client Library for Google Cloud Platform
Public Member Functions | List of all members
google::cloud::v1::GenericPollingPolicy< Retry, Backoff > Class Template Reference

#include <google/cloud/polling_policy.h>

Public Member Functions

 GenericPollingPolicy (Retry retry_policy, Backoff backoff_policy)
 
std::unique_ptr< PollingPolicyclone () const override
 Return a copy of the current policy. More...
 
bool OnFailure (google::cloud::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...
 

Detailed Description

template<typename Retry, typename Backoff>
class google::cloud::v1::GenericPollingPolicy< Retry, Backoff >

Definition at line 77 of file polling_policy.h.

Constructor & Destructor Documentation

◆ GenericPollingPolicy()

template<typename Retry , typename Backoff >
google::cloud::v1::GenericPollingPolicy< Retry, Backoff >::GenericPollingPolicy ( Retry  retry_policy,
Backoff  backoff_policy 
)
inline

Definition at line 79 of file polling_policy.h.

Member Function Documentation

◆ clone()

template<typename Retry , typename Backoff >
std::unique_ptr<PollingPolicy> google::cloud::v1::GenericPollingPolicy< Retry, Backoff >::clone ( ) const
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::v1::PollingPolicy.

Definition at line 84 of file polling_policy.h.

◆ OnFailure()

template<typename Retry , typename Backoff >
bool google::cloud::v1::GenericPollingPolicy< Retry, Backoff >::OnFailure ( google::cloud::Status const &  status)
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".

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

Implements google::cloud::v1::PollingPolicy.

Definition at line 88 of file polling_policy.h.

◆ WaitPeriod()

template<typename Retry , typename Backoff >
std::chrono::milliseconds google::cloud::v1::GenericPollingPolicy< Retry, Backoff >::WaitPeriod ( )
inlineoverridevirtual

How long should the polling loop wait before trying again.

Implements google::cloud::v1::PollingPolicy.

Definition at line 92 of file polling_policy.h.