Expand description
Shared retry/backoff helpers built on top of the backon crate.
These constructors give the node a single definition of the “standard” backoff schedules so
that retry behaviour stays consistent across components instead of being re-derived at each call
site. Use them together with the Retryable suffix extension, e.g.
ⓘ
use miden_node_utils::retry::{self, Retryable};
let value = (|| async { do_thing().await })
.retry(retry::exponential(min, max))
.when(|err| is_transient(err))
.notify(|err, dur| tracing::warn!(?dur, %err, "retrying"))
.await?;Traits§
- Backoff
Builder - BackoffBuilder is utilized to construct a new backoff.
- Retryable
- Retryable will add retry support for functions that produce futures with results.
Functions§
- constant
- Builds a constant-delay backoff schedule.
- exponential
- Builds an exponential backoff schedule that retries indefinitely.
- exponential_
bounded - Same as
exponential, but stops aftermax_timesretries (i.e.max_times + 1total attempts).