# `Foundation.Retry`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/retry.ex#L1)

Generic retry orchestration with configurable policies.

# `retry_result`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/retry.ex#L109)

```elixir
@type retry_result() ::
  {:retry, non_neg_integer(), Foundation.Retry.State.t()}
  | {:halt, term(), Foundation.Retry.State.t()}
```

# `check_timeouts`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/retry.ex#L151)

```elixir
@spec check_timeouts(
  Foundation.Retry.State.t(),
  Foundation.Retry.Policy.t(),
  keyword()
) ::
  :ok | {:error, atom()}
```

Check whether progress or elapsed-time limits have been exceeded.

# `record_progress`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/retry.ex#L166)

```elixir
@spec record_progress(
  Foundation.Retry.State.t(),
  keyword()
) :: Foundation.Retry.State.t()
```

Record progress to reset the progress timeout window.

# `run`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/retry.ex#L117)

```elixir
@spec run((-&gt; term()), Foundation.Retry.Policy.t(), keyword()) ::
  {term(), Foundation.Retry.State.t()}
```

Run a function with retry semantics.

# `step`
[🔗](https://github.com/nshkrdotcom/foundation/blob/v0.2.1/lib/foundation/retry.ex#L129)

```elixir
@spec step(Foundation.Retry.State.t(), Foundation.Retry.Policy.t(), term(), keyword()) ::
  retry_result()
```

Decide whether to retry based on the policy and current result.

---

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