StreamGroup<T> class

A collection of streams whose events are unified and sent through a central stream.

Both errors and data events are forwarded through stream. The streams in the group won't be listened to until stream has a listener. Note that this means that events emitted by broadcast streams will be dropped until stream has a listener.

If the StreamGroup is constructed using new StreamGroup, stream will be single-subscription. In this case, if stream is paused or canceled, all streams in the group will likewise be paused or canceled, respectively.

If the StreamGroup is constructed using new StreamGroup.broadcast, stream will be a broadcast stream. In this case, the streams in the group will never be paused and single-subscription streams in the group will never be canceled. Note that single-subscription streams in a broadcast group may drop events if a listener is added and later removed. Broadcast streams in the group will be canceled once stream has no listeners, and will be listened to again once stream has listeners.

stream won't close until close is called on the group and every stream in the group closes.

Implemented types

Constructors

StreamGroup()
Creates a new stream group where stream is single-subscriber.
StreamGroup.broadcast()
Creates a new stream group where stream is a broadcast stream.

Properties

stream Stream<T>
The stream through which all events from streams in the group are emitted.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

add(Stream<T> stream) Future
Adds stream as a member of this group. [...]
override
close() Future
Closes the group, indicating that no more streams will be added. [...]
override
remove(Stream<T> stream) Future
Removes stream as a member of this group. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Methods

merge<T>(Iterable<Stream<T>> streams) Stream<T>
Merges the events from streams into a single (single-subscriber) stream. [...]