CompositeEventSink<T> class
A composite event sink that forwards events to multiple target sinks.
This class is useful when you have a single source of events but need to broadcast those events to multiple destinations (sinks). It implements EventSink and distributes add, addError, and close calls to all provided child sinks.
- Implemented types
-
- EventSink<
T>
- EventSink<
- Available extensions
Constructors
-
CompositeEventSink(Iterable<
EventSink< sinks, {bool throwOnClosed = false, ExceptionStrategy exceptionStrategy = ExceptionStrategy.failFast})T> > -
Creates a new composite event sink that forwards events to the provided
sinks.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
T data) → void -
Adds a data
eventto the sink.override -
addError(
Object error, [StackTrace? stackTrace]) → void -
Adds an
errorto the sink.override -
close(
) → void -
Closes the sink.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
tryAdd(
T event, {bool ignoreError = false, void onError(Object error, StackTrace stackTrace)?}) → void -
tryAddError(
Object error, {StackTrace? stackTrace, bool ignoreError = false, void onError(Object error, StackTrace stackTrace)?}) → void -
Available on EventSink<
T> , provided by the OnEventSink extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited