# `ConduitMcp.Client.Backoff`
[🔗](https://github.com/nyo16/conduit_mcp/blob/v0.11.0/lib/conduit_mcp/client/backoff.ex#L1)

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.

# `full_jitter`

```elixir
@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 (default `500`).
  * `:cap` - the largest delay, in milliseconds (default `30_000`).

## Example

    iex> delay = ConduitMcp.Client.Backoff.full_jitter(1)
    iex> delay in 1..1_000
    true

---

*Consult [api-reference.md](api-reference.md) for complete listing*
