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