BoundedStreamBridge<T> class final

A lazy, terminal-on-error bridge with one explicitly bounded queue.

Single-subscription sources receive demand. Broadcast sources keep running into this queue rather than an unbounded paused subscription. Event weight is supplied by the caller; this class performs no serialization.

Constructors

BoundedStreamBridge({required Stream<T> source(), required int weigh(T), required StreamBufferLimits limits, StreamBridgeStats? stats, bool pauseSource = true, bool deferStart = true, void onStart()?, Object overflowError()?, Object sourceError(Object, StackTrace)?, Object elementError(Object, StackTrace)?, void onClosed(int, int, Object?)?})
Starts source on first listen, by default on the next microtask.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether the bridge has released its resources.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<T>
Its single-subscription output.
no setter

Methods

close() → void
Ends normally, releasing queued data and the source immediately.
fail(Object error, [StackTrace? stack]) → void
Ends with a terminal failure, dropping queued data immediately.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited