olp-cpp-sdk  1.15.4
Public Types | Public Attributes | List of all members
olp::client::RetrySettings Struct Reference

A collection of settings that controls how failed requests should be treated by the Data SDK. More...

#include <RetrySettings.h>

Public Types

using BackdownStrategy = std::function< std::chrono::milliseconds(std::chrono::milliseconds, size_t)>
 Calculates the number of retry timeouts based on the initial backdown duration and retries count.
using RetryCondition = std::function< bool(const HttpResponse &)>
 Checks whether the retry is desired. More...

Public Attributes

int max_attempts = 3
 The number of attempts. More...
int timeout = 60
 The connection timeout limit (in seconds).
int initial_backdown_period = 200
 The period between the error and the first retry attempt (in milliseconds).
BackdownStrategy backdown_strategy = ExponentialBackdownStrategy()
 The backdown strategy. More...
RetryCondition retry_condition = DefaultRetryCondition
 Evaluates responses to determine if the retry should be attempted.

Detailed Description

A collection of settings that controls how failed requests should be treated by the Data SDK.

For example, it specifies whether the failed request should be retried, how long Data SDK needs to wait for the next retry attempt, the number of maximum retries, and so on.

You can customize all of these settings. The settings are used internally by the OlpClient class.

Member Typedef Documentation

◆ RetryCondition

using olp::client::RetrySettings::RetryCondition = std::function<bool(const HttpResponse&)>

Checks whether the retry is desired.

See also
HttpResponse for more details.

Member Data Documentation

◆ backdown_strategy

BackdownStrategy olp::client::RetrySettings::backdown_strategy = ExponentialBackdownStrategy()

The backdown strategy.

Defines the delay between retries on a failed request.

◆ max_attempts

int olp::client::RetrySettings::max_attempts = 3

The number of attempts.

The default value is 3.

The documentation for this struct was generated from the following file: