olp-cpp-sdk
1.15.4
|
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. | |
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.
using olp::client::RetrySettings::RetryCondition = std::function<bool(const HttpResponse&)> |
Checks whether the retry is desired.
HttpResponse
for more details. BackdownStrategy olp::client::RetrySettings::backdown_strategy = ExponentialBackdownStrategy() |
The backdown strategy.
Defines the delay between retries on a failed request.
int olp::client::RetrySettings::max_attempts = 3 |
The number of attempts.
The default value is 3.