YandexDisk::RetryPolicy
Exponential backoff with full-range jitter.
delay_for(1) returns roughly base_delay, delay_for(2) roughly twice
that, and so on, clamped at max_delay and then randomised by ±jitter
so that a fleet of servers retrying at once does not stay in lockstep.
Constants
JITTER_RANDOM = Random.new
Shared across fibers on purpose: this only smears retry timings apart, so contention on the generator is cheaper than one instance per call.
Constructors
new(max_attempts : Int32 = 5, base_delay : Time::Span = 1.second, max_delay : Time::Span = 60.seconds, jitter : Float64 = 0.25)
SourceInstance methods
base_delay
Sourcejitter
Sourcemax_attempts
Sourcemax_delay
Source