ReceiverImpl<T>.internal constructor
- @Deprecated("Internal. Do not use, this exposed for compatibility with web.")
ReceiverImpl<T>.internal(
- Stream<T> stream,
- Future _onDone()
)
Implementation
@Deprecated("Internal. Do not use, this exposed for compatibility with web.")
ReceiverImpl.internal(Stream<T> stream, this._onDone) {
_streamSubscription = stream.listen((data) {
assert(!_isClosed);
_buffer.add(Ok(data));
if (!_waker.isCompleted) {
_waker.complete();
}
}, onError: (Object object, StackTrace stackTrace) {
assert(!_isClosed);
_buffer.add(Err(object));
if (!_waker.isCompleted) {
_waker.complete();
}
}, onDone: () {
assert(!_isClosed);
_isClosed = true;
_onDone.call();
_streamSubscription.cancel();
if (!_waker.isCompleted) {
_waker.complete();
}
}, cancelOnError: false);
}