FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::net::ExponentialBackoff Class Reference

#include <fastmm/net/backoff.hpp>

Public Member Functions

 ExponentialBackoff (BackoffConfig cfg={}, std::uint64_t seed=0x5eed) noexcept
 
std::uint32_t next_ms () noexcept
 Delay for the current attempt in milliseconds; advances the attempt counter.
 
void reset () noexcept
 
std::uint32_t attempt () const noexcept
 
const BackoffConfig & config () const noexcept
 
std::uint32_t capped_delay (std::uint32_t attempt) const noexcept
 Upper bound of the delay for attempt n (before jitter) - exposed for tests/metrics.
 

Constructor & Destructor Documentation

◆ ExponentialBackoff()

fastmm::net::ExponentialBackoff::ExponentialBackoff ( BackoffConfig  cfg = {},
std::uint64_t  seed = 0x5eed 
)
inlineexplicitnoexcept

Member Function Documentation

◆ next_ms()

std::uint32_t fastmm::net::ExponentialBackoff::next_ms ( )
inlinenoexcept

Delay for the current attempt in milliseconds; advances the attempt counter.

◆ reset()

void fastmm::net::ExponentialBackoff::reset ( )
inlinenoexcept

◆ attempt()

std::uint32_t fastmm::net::ExponentialBackoff::attempt ( ) const
inlinenoexcept

◆ config()

const BackoffConfig & fastmm::net::ExponentialBackoff::config ( ) const
inlinenoexcept

◆ capped_delay()

std::uint32_t fastmm::net::ExponentialBackoff::capped_delay ( std::uint32_t  attempt) const
inlinenoexcept

Upper bound of the delay for attempt n (before jitter) - exposed for tests/metrics.