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 | Any active pause gate |
pausedFromOutside | boolean | Manual/external pause gate |
pausedFromInside | boolean | Operator/generator pressure gate |
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 |
source | `Exstream | null` |
endOfChain | `Exstream | undefined` |
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. State is read-only; use lifecycle methods to transition it.
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.