StreamBridge<T> class final

Mirrors a source while forwarding demand and owning both cancellation paths.

This neutral relay preserves non-terminal source errors. It has no queue budget; use BoundedStreamBridge when a producer cannot be paused safely.

Constructors

StreamBridge({required Stream<T> source, bool subscribeOnFirstListen = false, void onFirstListen()?, void onSourceDone()?, void onSourceError(Object, StackTrace)?, void onConsumerCancel()?, void onCancelFailed(Object, StackTrace)?})
Mirrors source. Eager subscription is the default; a cold operation can opt into subscribeOnFirstListen. Hooks run before forwarding the event.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether the relay has ended.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<T>
The mirrored single-subscription stream.
no setter

Methods

cancelSource() → void
Stops the source without ending the output.
close() → void
Ends the relay, without waiting for arbitrary source cleanup.
fail(Object error, [StackTrace? stackTrace]) → void
Ends the relay with a terminal owner-supplied failure.
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