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

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

Issue 12049013: Change singleSubscription/multiSubscription to normal/broadcast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: sdk/lib/async/stream_controller.dart
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index ba8ac9e1863ab503848e440efecbe82de799aed9..ee79292a67e538388419f160cfccedd633a95774 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.dart
@@ -21,9 +21,8 @@ part of dart.async;
* it has subscribers or not, as well as getting a callback when either of
* these change.
*/
-class StreamController<T> extends Stream<T> implements StreamSink<T> {
floitsch 2013/01/22 14:37:56 This looks like an unrelated change. At least upda
Lasse Reichstein Nielsen 2013/01/22 15:33:37 Description updated.
+class StreamController<T> implements StreamSink<T> {
_StreamImpl<T> _stream;
floitsch 2013/01/22 14:37:56 Should we make this simply final and initialize it
Lasse Reichstein Nielsen 2013/01/22 15:33:37 Yes. We can do that now that the state-change-call
- Stream<T> get stream => _stream;
/**
* A controller with a [stream] that supports multiple subscribers.
@@ -60,19 +59,8 @@ class StreamController<T> extends Stream<T> implements StreamSink<T> {
onPauseStateChange);
}
- bool get isSingleSubscription => _stream.isSingleSubscription;
-
- Stream<T> asMultiSubscriptionStream() => _stream.asMultiSubscriptionStream();
-
- StreamSubscription listen(void onData(T data),
- { void onError(AsyncError error),
- void onDone(),
- bool unsubscribeOnError}) {
- return _stream.listen(onData,
- onError: onError,
- onDone: onDone,
- unsubscribeOnError: unsubscribeOnError);
- }
+ /** The stream that this controller is controlling. */
+ Stream<T> get stream => _stream;
/**
* Returns a view of this object that only exposes the [StreamSink] interface.
@@ -119,18 +107,6 @@ class StreamController<T> extends Stream<T> implements StreamSink<T> {
* should be the last message sent.
*/
void close() { _stream._close(); }
-
- void forEachSubscriber(void action(_StreamSubscriptionImpl<T> subscription)) {
- _stream._forEachSubscriber(() {
- try {
- action();
- } on AsyncError catch (e) {
- e.throwDelayed();
- } catch (e, s) {
- new AsyncError(e, s).throwDelayed();
- }
- });
- }
}
typedef void _NotificationHandler();

Powered by Google App Engine
This is Rietveld 408576698