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

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

Issue 12324004: Add test for whether a completer or stream controller has been closed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: sdk/lib/async/stream_controller.dart
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index e5b8b457c13bc4416b5b8001c34420939c70b20d..8394c007ae78108820a4307cd8a070efde2a7244 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.dart
@@ -63,6 +63,14 @@ class StreamController<T> implements StreamSink<T> {
*/
StreamSink<T> get sink => new StreamSinkView<T>(this);
+ /**
+ * Whether the stream is closed for adding more events.
+ *
+ * If true, the "done" event might not have fired yet, but it has been
+ * scheduled, and it is too late to add more events.
+ */
+ bool get isClosed => stream._isClosed;
+
/** Whether one or more active subscribers have requested a pause. */
bool get isPaused => stream._isPaused;

Powered by Google App Engine
This is Rietveld 408576698