olp-cpp-sdk
1.21.0
|
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 |
Maximum time for request to complete (in seconds). More... | |
std::chrono::milliseconds | connection_timeout = std::chrono::seconds(30) |
Time allowed to wait for connection to establish (in milliseconds). More... | |
std::chrono::milliseconds | transfer_timeout = std::chrono::seconds(30) |
Time allowed to wait without data transfer (in milliseconds). More... | |
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.
std::chrono::milliseconds olp::client::RetrySettings::connection_timeout = std::chrono::seconds(30) |
Time allowed to wait for connection to establish (in milliseconds).
The default value is 30 seconds.
timeout
, timeout
for more details. int olp::client::RetrySettings::max_attempts = 3 |
The number of attempts.
The default value is 3.
int olp::client::RetrySettings::timeout = 60 |
Maximum time for request to complete (in seconds).
The default value is 60.
connection_timeout
and transfer_timeout
values. std::chrono::milliseconds olp::client::RetrySettings::transfer_timeout = std::chrono::seconds(30) |
Time allowed to wait without data transfer (in milliseconds).
The default value is 30 seconds.
timeout
, timeout
for more details.