API · Core
Stream state
Inspect lifecycle and pressure without reaching into private queues.
Properties
| Property | Type | Meaning |
|---|---|---|
state | ‘idle’ | ‘running’ | ‘ending’ | ‘ended’ | ‘destroyed’ | ‘aborted’ | Current lifecycle state |
ended | boolean | True for ended, destroyed, or aborted |
abortReason | unknown | Explicit abort/fatal reason; null for normal end/destroy |
signal | AbortSignal | Lazily created branch cancellation signal |
paused | boolean | Whether aggregate backpressure currently stops this stream |
buffered | number | Currently queued data and error records |
peakBuffered | number | Maximum queued record count observed |
dropped | number | Records discarded by an overflow drop policy |
bufferLimit | number | Configured maximum queued records |
overflowPolicy | ‘error’ | ‘drop-oldest’ | ‘drop-newest’ | Configured full-buffer action |
writable, readable | boolean | Capability flags for adapters |
Invariants
End markers do not count toward buffered. peakBuffered and dropped are cumulative for the stream lifetime. Accessing signal after termination returns an already-aborted signal with the stored lifecycle reason. Lifecycle and pressure state are read-only: downstream demand, normal completion, failures, and AbortSignal cancellation drive their transitions.
These values are useful for diagnostics and observability, not for polling-based flow control. Producers should use the boolean from write() and the drain event. Upstream graph links and individual scheduler pause gates are private implementation details.