Files
url_tracker_tool/node_modules/bullmq/dist/esm/classes/async-fifo-queue.d.ts
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

44 lines
1.4 KiB
TypeScript

/**
* AsyncFifoQueue
*
* A minimal FIFO queue for asynchronous operations. Allows adding asynchronous operations
* and consume them in the order they are resolved.
*
* TODO: Optimize using a linked list for the queue instead of an array.
* Current implementation requires memory copies when shifting the queue.
* For a linked linked implementation, we can exploit the fact that the
* maximum number of elements in the list will never exceen the concurrency factor
* of the worker, so the nodes of the list could be pre-allocated.
*/
export declare class AsyncFifoQueue<T> {
private ignoreErrors;
/**
* A queue of completed promises. As the pending
* promises are resolved, they are added to this queue.
*/
private queue;
/**
* A set of pending promises.
*/
private pending;
/**
* The next promise to be resolved. As soon as a pending promise
* is resolved, this promise is resolved with the result of the
* pending promise.
*/
private nextPromise;
private resolve;
private reject;
constructor(ignoreErrors?: boolean);
add(promise: Promise<T>): void;
waitAll(): Promise<void>;
numTotal(): number;
numPending(): number;
numQueued(): number;
private resolvePromise;
private rejectPromise;
private newPromise;
private wait;
fetch(): Promise<T | void>;
}