StreamChannel< T>.withGuarantees constructor
Creates a new StreamChannel that communicates over stream and sink.
Unlike new StreamChannel, this enforces the guarantees listed in the StreamChannel documentation. This makes it somewhat less efficient than just wrapping a stream and a sink directly, so new StreamChannel should be used when the guarantees are provided natively.
If allowSinkErrors is false, errors are not allowed to be passed to
sink. If any are, the connection will close and the error will be
forwarded to sink.done.
Implementation
factory StreamChannel.withGuarantees(Stream<T> stream, StreamSink<T> sink,
{bool allowSinkErrors: true}) =>
new GuaranteeChannel(stream, sink, allowSinkErrors: allowSinkErrors);