A object that accepts stream events both synchronously and asynchronously.
A StreamSink combines the methods from StreamConsumer and EventSink.
The EventSink methods can't be used while the addStream is called. As soon as the addStream's Future completes with a value, the EventSink methods can be used again.
If addStream is called after any of the EventSink methods, it'll be delayed until the underlying system has consumed the data added by the EventSink methods.
When EventSink methods are used, the done Future can be used to catch any errors.
- Implemented types
-
- EventSink<
S> - StreamConsumer<
S>
- EventSink<
- Implementers
- Available extensions
Properties
- done → Future
-
Return a future which is completed when the StreamSink is finished.
no setter
- 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(
S event) → void -
Adds a data
event
to the sink.inherited -
addError(
Object error, [StackTrace? stackTrace]) → void -
Adds an
error
to the sink.inherited -
addStream(
Stream< S> stream) → Future -
Consumes the elements of
stream
.inherited -
close(
) → Future -
Tells the stream sink that no further streams will be added.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rejectErrors(
) → StreamSink< T> -
Available on StreamSink<
Returns a StreamSink that forwards toT> , provided by the StreamSinkExtensions extensionthis
but rejects errors. -
toString(
) → String -
A string representation of this object.
inherited
-
transform<
S> (StreamSinkTransformer< S, T> transformer) → StreamSink<S> -
Available on StreamSink<
Transforms a StreamSink usingT> , provided by the StreamSinkExtensions extensiontransformer
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited