Class: Queue<T>
async.Queue
Asynchronous producer/consumer queue.
Type parameters
Name |
---|
T |
Constructors
constructor
• new Queue<T
>(): Queue
<T
>
Create a new asynchronous producer/consumer queue.
Type parameters
Name |
---|
T |
Returns
Queue
<T
>
Properties
events
• Private
events: T
[]
poppers
• Private
poppers: ResolvablePromise
<T
>[]
Methods
pop
▸ pop(): Promise
<T
>
Pop an event from the queue. Returns a Promise that resolves once an event is pushed to the queue. If there are queued events the Promise resolves instantly.
Returns
Promise
<T
>
push
▸ push(event
): void
Push an event to the queue. If there are pending pop requests they will be resolved instantly.
Parameters
Name | Type | Description |
---|---|---|
event |
T |
Event to push |
Returns
void
update
▸ update(): void
Returns
void