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

Issue 11886013: Make Stream transformation respect the single/multi subscriber nature of the source. (Closed)

Created:
7 years, 11 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 11 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make Stream transformation respect the single/multi subscriber nature of the source. Add .isSingleSubscriber getter to Stream, and make use of it to create different streams for the transformations. _ForwardingStreamTransformation is no longer itself a stream, but creates a stream depending on the source. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=17044

Patch Set 1 #

Patch Set 2 : Added missing isSingleSubscription impl. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -187 lines) Patch
M sdk/lib/async/stream.dart View 1 13 chunks +20 lines, -12 lines 3 comments Download
M sdk/lib/async/stream_controller.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/async/stream_impl.dart View 3 chunks +42 lines, -1 line 2 comments Download
M sdk/lib/async/stream_pipe.dart View 16 chunks +133 lines, -174 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-14 12:18:14 UTC) #1
floitsch
LGTM. But I'm thinking more and more that Streams should be constructed the same ways ...
7 years, 11 months ago (2013-01-14 16:09:09 UTC) #2
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-15 07:19:50 UTC) #3
https://codereview.chromium.org/11886013/diff/6/sdk/lib/async/stream.dart
File sdk/lib/async/stream.dart (right):

https://codereview.chromium.org/11886013/diff/6/sdk/lib/async/stream.dart#new...
sdk/lib/async/stream.dart:124: * or simply return to make the stream forget the
error.
On 2013/01/14 16:09:09, floitsch wrote:
> different CL: "if the error needs to be transformed into a value, use the
[XYZ]
> transformer."
> Maybe just add a TODO for now?.

Done.

https://codereview.chromium.org/11886013/diff/6/sdk/lib/async/stream_impl.dart
File sdk/lib/async/stream_impl.dart (right):

https://codereview.chromium.org/11886013/diff/6/sdk/lib/async/stream_impl.dar...
sdk/lib/async/stream_impl.dart:546: bool get isSingleSubscription => false;
On 2013/01/14 16:09:09, floitsch wrote:
> I don't think anybody wants to override this method :)
> Move it above the comments.

Done.

Powered by Google App Engine
This is Rietveld 408576698