Returns the number of values stored in this queue.
Appends a new value to the end of the queue.
The value to append.
Returns a promise that is fulfilled with a value when it is available.
Values are taken in the same order they were appended. Taken values are removed from the queue.
The promise that is fulfilled with a value that was added to the queue. Aborting the returned promise after the value was taken is a no-op.
Returns a promise that is fulfilled with a value and an acknowledgement callback.
The promise is fulfilled when a value is available. Consequent consumers are blocked until the acknowledgement callback is invoked. Invoking acknowledgement callback multiple times is a no-op.
Note: Be sure to always call an acknowledgement callback. Otherwise, consequent consumers would never be fulfilled.
A tuple that contains a value available in the queue, and a callback that acknowledges that the value was processed and should be removed from the queue. Aborting the returned promise after a consumer received an acknowledgement callback is a no-op.
Asynchronous queue decouples value producers and value consumers.