true if channels has been closed and there are no pending writes.
true if channel has been closed for writing.
error passed to fail, undefined if channel has not failed.
true if channel has been failed through fail.
number of pending reads.
number of pending writes.
Closes writing only.
Writes beyond capacity are settled with optional err.
If there are no pending writes channel is effectively done - closed for reading and writing.
Optionalerr: unknownclose for closing channel for reading and writing.
all values that was possible to read immediatelly, aka all pending writes.
Fails the channel: closes it for reading and writing, rejects pending writes with err
(even when err is falsy) and rejects pending and subsequent reads with err.
Unlike close, which completes readers normally, this propagates a producer error
to consumers (next(), read(), maybeRead() and for await reject with err).
No-op if the channel is already closed for writing.
Reads the next value, returning undefined after channel completion.
When T includes undefined, a queued undefined value and channel
completion have the same return value. Use next() and inspect done when
that distinction matters.
Optionalvalue: anyOptionalerr: anyWrites value; resolves once a reader took it or it was buffered.
Aborting signal while the write is still blocked withdraws it — the
value is never delivered — and rejects with signal.reason; a write that
was already accepted is unaffected. A signal that is already aborted
rejects without touching the channel.
Closes channel for both reading and writing.
Idempotent: a channel that is already closed for writing (for example a producer that finished before the consumer stopped iterating) is drained without throwing.