Reconnect delays for ConduitMcp.Client.
full_jitter/2 is the default :backoff of ConduitMcp.Client.Config:
a uniformly random delay between 1 ms and min(cap, base * 2 ** attempt)
("full jitter"), so many clients that lost the same server do not
reconnect in lockstep. attempt is 1 for the first reconnect.
Summary
Functions
A full-jitter exponential delay in milliseconds for reconnect attempt.
Functions
@spec full_jitter(non_neg_integer(), keyword()) :: pos_integer()
A full-jitter exponential delay in milliseconds for reconnect attempt.
Options
:base- the first step, in milliseconds (default500).:cap- the largest delay, in milliseconds (default30_000).
Example
iex> delay = ConduitMcp.Client.Backoff.full_jitter(1)
iex> delay in 1..1_000
true