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
pausedbooleanWhether aggregate backpressure currently stops this stream
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

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.

events, write(), end(), pipeTo()