GraphReFlyTS

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

ParameterTypeDescription
policyBackoffPolicyBackoff policy to evaluate.
attemptnumberOne-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