A object that accepts stream events both synchronously and asynchronously.
AStreamSink combines the methods fromStreamConsumer andEventSink.
TheEventSink methods can't be used while theaddStream is called.As soon as theaddStream'sFuture completes with a value, theEventSink methods can be used again.
IfaddStream is called after any of theEventSink methods, it'llbe delayed until the underlying system has consumed the data added by theEventSink methods.
WhenEventSink methods are used, thedoneFuture can be used tocatch any errors.
- Implemented types
- EventSink<
S> - StreamConsumer<
S>
- EventSink<
- Implementers
Properties
- done→Future
- Return a future which is completed when theStreamSink 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(
Sevent)→ void - Adds a data
eventto the sink.inherited - addError(
Objecterror, [StackTrace?stackTrace])→ void - Adds an
errorto 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(
Invocationinvocation)→ dynamic - Invoked when a nonexistent method or property is accessed.inherited
- toString(
)→String - A string representation of this object.inherited
Operators
- operator ==(
Objectother)→bool - The equality operator.inherited