FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
backoff.hpp File Reference

Exponential backoff with jitter for reconnects: delay_n = cap_n * (1 - jitter) + U(0, cap_n * jitter) where cap_n = min(max_ms, base_ms * 2^n). More...

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <random>

Go to the source code of this file.

Classes

struct  fastmm::net::BackoffConfig
 
class  fastmm::net::ExponentialBackoff
 

Namespaces

namespace  fastmm
 
namespace  fastmm::net
 

Detailed Description

Exponential backoff with jitter for reconnects: delay_n = cap_n * (1 - jitter) + U(0, cap_n * jitter) where cap_n = min(max_ms, base_ms * 2^n).

jitter = 1.0 is the "full jitter" scheme (recommended: spreads a thundering herd of reconnects after a venue outage), jitter = 0 is deterministic (useful in tests).