Whether the queue has been closed or failed.
Number of items buffered and not yet consumed.
Signals that no more items will be produced. Any awaiting consumer receives
{done: true}. Idempotent.
Signals that production failed. Buffered items are still delivered first;
once the buffer drains, the consumer's next next() rejects with error.
Sticky (first failure wins) and closes the queue.
Enqueues a value. If a consumer is currently awaiting, it is resolved immediately; otherwise the value is buffered. No-op once closed/failed.
A generic, single-consumer async queue that implements AsyncIterable, bridging a push producer to a pull consumer (
for await (const x of q)).Producers call push as values are produced and close (or fail) when finished. A single consumer drains the queue.
Semantics:
done: true); idempotent.close()can't discard the error.