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

Unified Diff: sdk/lib/async/stream_controller.dart

Issue 50373003: Expose the cancelOnError in the StreamController.addStream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | tests/lib/async/stream_controller_async_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_controller.dart
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index 6fc0dca91a3570c6b5c9a0ed27f4ab077c9311bc..b40ffb5f2d3d158799bd6c33ee35f0d618fe7ff6 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.dart
@@ -167,6 +167,26 @@ abstract class StreamController<T> implements StreamSink<T> {
* allows.
*/
void addError(Object error, [StackTrace stackTrace]);
+
+ /**
+ * Receives events from [source] and puts them into this controller's stream.
+ *
+ * Returns a future which completes when the source stream is done.
+ *
+ * Events must not be added directly to this controller using [add],
+ * [addError], [close] or [addStream], until the returned future
+ * is complete.
+ *
+ * Data and error events are forwarded to this controller's stream. A done
+ * event on the source will end the `addStream` operation and complete the
+ * returned future.
+ *
+ * If [cancelOnError] is true, only the first error on [source] is
+ * forwarded to the controller's stream, and the `addStream` ends
+ * after this. If [cancelOnError] is false, all errors are forwarded
+ * and only a done event will end the `addStream`.
+ */
+ Future addStream(Stream<T> source, {bool cancelOnError: true});
}
@@ -344,24 +364,6 @@ abstract class _StreamController<T> implements StreamController<T>,
}
// StreamSink interface.
- /**
- * Receives events from [source] and puts them into this controller's stream.
- *
- * Returns a future which completes when the source stream is done.
- *
- * Events must not be added directly to this controller using [add],
- * [addError], [close] or [addStream], until the returned future
- * is complete.
- *
- * Data and error events are forwarded to this controller's stream. A done
- * event on the source will end the `addStream` operation and complete the
- * returned future.
- *
- * If [cancelOnError] is true, only the first error on [source] is
- * forwarded to the controller's stream, and the `addStream` ends
- * after this. If [cancelOnError] is false, all errors are forwarded
- * and only a done event will end the `addStream`.
- */
Future addStream(Stream<T> source, { bool cancelOnError: true }) {
if (!_mayAddEvent) throw _badEventState();
if (_isCanceled) return new _Future.immediate(null);
« no previous file with comments | « no previous file | tests/lib/async/stream_controller_async_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698