Files
med-notes/.pnpm-store/v10/files/bf/79eb45a38b128d2b8908174cf759b27e444230dafbe8978ea27685642fc5ad8af8c3de63648a6d46a7a3e5e9125e800f3b288ec6b8d821759d1df78da72982
2025-05-09 05:30:08 +02:00

29 lines
1019 B
Plaintext

/**
* A class that manages a queue of retry jobs.
*/
export class Retrier {
/**
* Creates a new instance.
* @param {Function} check The function to call.
* @param {object} [options] The options for the instance.
* @param {number} [options.timeout] The timeout for the queue.
* @param {number} [options.maxDelay] The maximum delay for the queue.
*/
constructor(check: Function, { timeout, maxDelay }?: {
timeout?: number | undefined;
maxDelay?: number | undefined;
} | undefined);
/**
* Adds a new retry job to the queue.
* @param {Function} fn The function to call.
* @param {object} [options] The options for the job.
* @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
* @returns {Promise<any>} A promise that resolves when the queue is
* processed.
*/
retry(fn: Function, { signal }?: {
signal?: AbortSignal | undefined;
} | undefined): Promise<any>;
#private;
}