This shows how to override the retry policies for dialogflow_es::VersionsClient:
auto options =
.
set<google::cloud::dialogflow_es::
VersionsConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::dialogflow_es::VersionsRetryPolicyOption>(
VersionsLimitedErrorCountRetryPolicy(3)
.clone())
.set<google::cloud::dialogflow_es::VersionsBackoffPolicyOption>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
auto connection =
connection,
std::chrono::minutes(5))
.clone()));
Options & set(ValueTypeT< T > v)
Service for managing Versions.
Definition: versions_client.h:64
Definition: agents_client.h:33
std::shared_ptr< VersionsConnection > MakeVersionsConnection(std::string const &location, Options options={})
A factory function to construct an object of type VersionsConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< dialogflow_es_internal::VersionsRetryTraits > VersionsLimitedTimeRetryPolicy
Definition: versions_connection.h:43
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: versions_options.h:39
Assuming you have created a custom idempotency policy. Such as:
class CustomIdempotencyPolicy
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: versions_connection_idempotency_policy.h:33
virtual std::unique_ptr< VersionsConnectionIdempotencyPolicy > clone() const
Create a new copy of this object.