Skip to main content

with_retries_gated

Function with_retries_gated 

Source
pub(crate) async fn with_retries_gated<G, GFut, F, Fut, T, E, A>(
    cfg: &RetryCfg,
    gate: G,
    op: F,
) -> GatedOutcome<T, E, A>
where G: FnMut() -> GFut, GFut: Future<Output = Result<(), A>>, F: FnMut() -> Fut, Fut: Future<Output = Result<T, (Retry, E)>>,
Expand description

Like with_retries, but awaits gate() before every try; an abort returns GatedOutcome::Aborted. Session loss or lease expiry stops target-side steps between tries, never mid-call. Sleeps are not capped to a deadline: the gate checks execute_by before the next try.