UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

33 lines (32 loc) 802 B
/** * @module Async */ import { TimeSpan } from "../../../utilities/_module-exports.js"; import { type BackoffPolicy } from "../../../async/backof-policies/_shared.js"; /** * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group BackoffPolicies */ export type ConstantBackoffPolicySettings = { /** * @default 1000 milliseconds */ delay?: TimeSpan; /** * @default {0.5} */ jitter?: number; /** * Used only for testing * @internal */ _mathRandom?: () => number; }; /** * Constant backoff policy with jitter * * IMPORT_PATH: `"@daiso-tech/core/async"` * @group BackoffPolicies */ export declare function constantBackoffPolicy(settings?: ConstantBackoffPolicySettings | ((error: unknown) => ConstantBackoffPolicySettings)): BackoffPolicy;