olp-cpp-sdk
1.21.0
|
Computes wait time for the next retry attempt via the exponential backoff with the added jitter. More...
#include <BackdownStrategy.h>
Public Member Functions | |
EqualJitterBackdownStrategy (std::chrono::milliseconds cap=std::chrono::seconds(1)) | |
Creates a EqualJitterBackdownStrategy instance. More... | |
std::chrono::milliseconds | operator() (std::chrono::milliseconds initial_backdown_period, size_t retry_count) |
Computes the next retry attempt wait time based on the number of retries and initial backdown period. More... | |
Computes wait time for the next retry attempt via the exponential backoff with the added jitter.
This backoff strategy is based on the Equal Jitter approach. See https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
The actual formula can be described in the following way:
|
inlineexplicit |
Creates a EqualJitterBackdownStrategy instance.
cap | The maximum cap used in the wait time formula. |
|
inline |
Computes the next retry attempt wait time based on the number of retries and initial backdown period.
initial_backdown_period | The initial backdown period. |
retry_count | The number of retries that are already made. |