This shows how to override the retry policies for dialogflow_cx::ExperimentsClient:
auto options =
.
set<google::cloud::dialogflow_cx::
ExperimentsConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::dialogflow_cx::ExperimentsRetryPolicyOption>(
ExperimentsLimitedErrorCountRetryPolicy(3)
.clone())
.set<google::cloud::dialogflow_cx::ExperimentsBackoffPolicyOption>(
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 Experiments.
Definition: experiments_client.h:65
Definition: agents_client.h:33
std::shared_ptr< ExperimentsConnection > MakeExperimentsConnection(std::string const &location, Options options={})
A factory function to construct an object of type ExperimentsConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< dialogflow_cx_internal::ExperimentsRetryTraits > ExperimentsLimitedTimeRetryPolicy
Definition: experiments_connection.h:43
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: experiments_options.h:39
Assuming you have created a custom idempotency policy. Such as:
ExperimentsConnectionIdempotencyPolicy {
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<
clone() const override {
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: experiments_connection_idempotency_policy.h:33