Home > @rushstack/node-core-library > AsyncQueue
AsyncQueue class
A queue that allows for asynchronous iteration. During iteration, the queue will wait until the next item is pushed into the queue before yielding. If instead all queue items are consumed and all callbacks have been called, the queue will return.
Signature:
export declare class AsyncQueue<T> implements AsyncIterable<[T, () => void]>
Implements: AsyncIterable<[T, () => void]>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(iterable) | Constructs a new instance of the AsyncQueue class |
Methods
Method | Modifiers | Description |
---|---|---|
[Symbol.asyncIterator]() | ||
push(item) | Adds an item to the queue. |