API · Core

Stream state

Inspect lifecycle and pressure without reaching into private queues.

Properties

PropertyTypeMeaning
state'idle' \| 'running' \| 'ending' \| 'ended' \| 'destroyed' \| 'aborted'Current lifecycle state
endedbooleanTrue for ended, destroyed, or aborted
abortReasonunknownExplicit abort/fatal reason; null for normal end/destroy
signalAbortSignalLazily created branch cancellation signal
pausedbooleanAny active pause gate
pausedFromOutsidebooleanManual/external pause gate
pausedFromInsidebooleanOperator/generator pressure gate
bufferednumberCurrently queued data and error records
peakBufferednumberMaximum queued record count observed
droppednumberRecords discarded by an overflow drop policy
bufferLimitnumberConfigured maximum queued records
overflowPolicy'error' \| 'drop-oldest' \| 'drop-newest'Configured full-buffer action
writable, readablebooleanCapability flags for adapters
source`Exstreamnull`
endOfChain`Exstreamundefined`

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.

events, write(), pause(), abort()