Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: lib/src/guarantee_channel.dart

Issue 1671763002: Make IsolateChannel use StreamChannelCompleter. (Closed) Base URL: git@github.com:dart-lang/stream_channel.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/isolate_channel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/guarantee_channel.dart
diff --git a/lib/src/guarantee_channel.dart b/lib/src/guarantee_channel.dart
index 1047e14ff213bbc27b4715a63dd9e5366cf1a26c..a874799c1f3845248b49263124e5fc30e65815c3 100644
--- a/lib/src/guarantee_channel.dart
+++ b/lib/src/guarantee_channel.dart
@@ -127,6 +127,14 @@ class _GuaranteeSink<T> implements StreamSink<T> {
}
if (_disconnected) return;
+ _addError(error, stackTrace);
+ }
+
+ /// Like [addError], but doesn't check to ensure that an error can be added.
+ ///
+ /// This is called from [addStream], so it shouldn't fail if a stream is being
+ /// added.
+ void _addError(error, [StackTrace stackTrace]) {
if (_allowErrors) {
_inner.addError(error, stackTrace);
return;
@@ -153,7 +161,7 @@ class _GuaranteeSink<T> implements StreamSink<T> {
_addStreamCompleter = new Completer.sync();
_addStreamSubscription = stream.listen(
_inner.add,
- onError: _inner.addError,
+ onError: _addError,
onDone: _addStreamCompleter.complete);
return _addStreamCompleter.future.then((_) {
_addStreamCompleter = null;
« no previous file with comments | « no previous file | lib/src/isolate_channel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698