@shopify/cli-kit
Version:
A set of utilities, interfaces, and models that are common across all the platform features
17 lines (16 loc) • 660 B
TypeScript
export declare const DEFAULT_MAX_TIME_MS = 10000;
interface BackoffResult {
remainingMs: number;
iterations: number;
}
/**
* Generator that sleeps with exponential backoff between yields, stopping before exceeding a time limit
*
* Yields the amount of time slept in milliseconds.
*
* @param maxTimeMs - Maximum total time in milliseconds before stopping
* @param firstDelayMs - First delay in milliseconds
* @returns Information about the backoff sequence: remaining time and iteration count
*/
export declare function sleepWithBackoffUntil(maxTimeMs?: number, firstDelayMs?: number): AsyncGenerator<number, BackoffResult, unknown>;
export {};