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

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

Issue 11791045: Added toMultiSubscriber on Stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Now lazily subscribes to source. Created 7 years, 11 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 | sdk/lib/async/stream_impl.dart » ('j') | sdk/lib/async/stream_pipe.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 996dc35c439a3052e24b18fbd63cdb0f76695f60..fdecc4788b033073485558b74e6217bae39f765d 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -32,6 +32,18 @@ abstract class Stream<T> {
}
/**
+ * Returns a multi-subscription stream that produces the same events as this.
+ *
+ * If this stream is single-subscription, return a new stream that allows
+ * multiple subscribers. It will subscribe to this stream when its first
+ * subscriber is added, and unsubscribe again when the last subscription is
+ * cancelled.
+ *
+ * If this stream is already multi-subscriber, it is returned unmodified.
+ */
+ Stream<T> asMultiSubscriberStream();
+
+ /**
* Stream that outputs events from the [sources] in cyclic order.
*
* The merged streams are paused and resumed in order to ensure the proper
« no previous file with comments | « no previous file | sdk/lib/async/stream_impl.dart » ('j') | sdk/lib/async/stream_pipe.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698