pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::orch::RetryPolicy Struct Reference

When and how long to retry. More...

#include <provider.hpp>

Public Attributes

int max_retries = 2
 Retries after the first attempt. 0 turns retrying off.
 
std::chrono::milliseconds initial_backoff {1000}
 The first backoff. Each retry doubles it up to max_backoff, and the wait is a random fraction of that ("full jitter"), so many clients don't retry in step.
 
std::chrono::milliseconds max_backoff {30'000}
 
std::chrono::milliseconds max_retry_after {60'000}
 The longest retry-after to honor. A longer one fails at once instead of waiting.
 
std::function< void(std::chrono::milliseconds)> sleep
 Waits between attempts; replaceable so tests don't sleep. Empty: really sleep.
 
uint64_t seed = 0x5eed
 The seed for the jitter.
 

Detailed Description

When and how long to retry.

Member Data Documentation

◆ initial_backoff

std::chrono::milliseconds pulsatrix::orch::RetryPolicy::initial_backoff {1000}

The first backoff. Each retry doubles it up to max_backoff, and the wait is a random fraction of that ("full jitter"), so many clients don't retry in step.

◆ max_backoff

std::chrono::milliseconds pulsatrix::orch::RetryPolicy::max_backoff {30'000}

◆ max_retries

int pulsatrix::orch::RetryPolicy::max_retries = 2

Retries after the first attempt. 0 turns retrying off.

◆ max_retry_after

std::chrono::milliseconds pulsatrix::orch::RetryPolicy::max_retry_after {60'000}

The longest retry-after to honor. A longer one fails at once instead of waiting.

◆ seed

uint64_t pulsatrix::orch::RetryPolicy::seed = 0x5eed

The seed for the jitter.

◆ sleep

std::function<void(std::chrono::milliseconds)> pulsatrix::orch::RetryPolicy::sleep

Waits between attempts; replaceable so tests don't sleep. Empty: really sleep.


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