Rush StackShopBlogEvents
Skip to main content

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

ConstructorModifiersDescription
(constructor)(iterable)Constructs a new instance of the AsyncQueue class

Methods

MethodModifiersDescription
[Symbol.asyncIterator]()
push(item)Adds an item to the queue.