AsyncQueue
AsyncQueue
Signature
class AsyncQueue {
constructor(options: AsyncQueueOptions = {})
add(task: AsyncQueueTask<T>, signal?: AbortSignal) => Promise<T>;
pause() => ;
resume() => ;
abort() => ;
clear() => ;
getRunning() => number;
getPending() => number;
isPaused() => boolean;
isAborted() => boolean;
}
constructor
method
(options: AsyncQueueOptions = {}) => AsyncQueueadd
method
(task: AsyncQueueTask<T>, signal?: AbortSignal) => Promise<T>Adds a task to the queue.
pause
method
() => Pauses the queue. No new tasks will be started until resumed.
resume
method
() => Resumes the queue and processes pending tasks.
abort
method
() => Aborts the queue, rejecting all pending tasks.
clear
method
() => Clears all pending tasks from the queue.
getRunning
method
() => numberReturns the number of running tasks.
getPending
method
() => numberReturns the number of pending tasks in the queue.
isPaused
method
() => booleanReturns true if the queue is currently paused.
isAborted
method
() => booleanReturns true if the queue has been aborted.