StreamChannel<T>.withCloseGuarantee constructor

StreamChannel<T>.withCloseGuarantee(
  1. Stream<T> stream,
  2. StreamSink<T> sink
)

Creates a new StreamChannel that communicates over stream and sink.

This specifically enforces the guarantee that closing the sink causes the stream to emit a done event.

Implementation

factory StreamChannel.withCloseGuarantee(
        Stream<T> stream, StreamSink<T> sink) =>
    _CloseGuaranteeChannel(stream, sink);