backoffDelayMs()
Compute the delay for a backoff policy at a specific attempt.
Import
Section titled “Import”import { backoffDelayMs } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function backoffDelayMs( policy: BackoffPolicy, attempt: number,): numberParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
policy | BackoffPolicy | Backoff policy to evaluate. |
attempt | number | One-based attempt counter. |
Returns
Section titled “Returns”The computed delay in milliseconds.
Example
Section titled “Example”backoffDelayMs({ kind: "linear", initialMs: 100, stepMs: 50 }, 3);Source
Section titled “Source”packages/ts/src/graph/resilience.ts