StreamExtension<T> extension
A StreamExtension is an extension for Stream with various useful methods.
- on
-
- Stream<
T>
- Stream<
Methods
-
asCancelable(
CancellationToken token, {bool blockOnCancel = true, PauseToken? pauseToken, Duration? timeout}) → Stream< T> -
Available on Stream<
Returns a stream that allows toT> , provided by the StreamExtension extensioncancela subscription using acancellation tokenor a specifiedtimeout, with support fornon-blockingcancellation, and with support for sending a request topausea stream andresumeafter a pause using apause token. -
asPausable(
PauseToken token) → Stream< T> -
Available on Stream<
Returns a stream that allows to pause/resume a stream subscription using a PauseToken.T> , provided by the StreamExtension extension -
handleTermination(
void onTerminate()?, {void onCancel()?, void onDone()?, void onError(Object error, StackTrace stackTrace)?}) → Stream< T> -
Available on Stream<
Returns a stream that allows to define the termination handlerT> , provided by the StreamExtension extensiononTerminateand the status handlersonCancel,onDoneandonError.