@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) • 805 B
TypeScript
/**
* @module Async
*/
import { TimeSpan } from "../../../utilities/_module-exports.js";
import { type BackoffPolicy, type DynamicBackoffPolicy } 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;
/**
* @internal
* Should only be used for testing
*/
_mathRandom?: () => number;
};
/**
* Constant backoff policy with jitter
*
* IMPORT_PATH: `"@daiso-tech/core/async"`
* @group BackoffPolicies
*/
export declare function constantBackoffPolicy(settings?: DynamicBackoffPolicy<ConstantBackoffPolicySettings>): BackoffPolicy;