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

Issue 11794044: Add Stream.fromIterable (Closed)

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

Description

Add Stream.fromIterable Also add Iterable.generate as helper. Should we have Stream.generate as well? Committed: https://code.google.com/p/dart/source/detail?r=16848

Patch Set 1 #

Patch Set 2 : Generate now works. #

Patch Set 3 : Switch to lazy iteration. Use a single-subscription stream. #

Patch Set 4 : Added the test file too. #

Total comments: 10

Patch Set 5 : Address comments. Fix bug hit by new test. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+191 lines, -51 lines) Patch
M sdk/lib/async/stream.dart View 1 2 3 4 1 chunk +13 lines, -6 lines 0 comments Download
M sdk/lib/async/stream_impl.dart View 1 2 3 4 2 chunks +57 lines, -2 lines 0 comments Download
M sdk/lib/core/iterable.dart View 1 2 3 4 2 chunks +36 lines, -0 lines 1 comment Download
M sdk/lib/isolate/isolate_stream.dart View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
A + tests/lib/async/slow_consumer3_test.dart View 1 2 3 4 2 chunks +11 lines, -38 lines 0 comments Download
A tests/lib/async/stream_from_iterable_test.dart View 1 2 3 4 1 chunk +67 lines, -0 lines 0 comments Download
M tests/lib/lib.status View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-08 10:13:18 UTC) #1
Lasse Reichstein Nielsen
PTAL
7 years, 11 months ago (2013-01-08 12:08:34 UTC) #2
floitsch
LGTM. https://codereview.chromium.org/11794044/diff/5/sdk/lib/core/iterable.dart File sdk/lib/core/iterable.dart (right): https://codereview.chromium.org/11794044/diff/5/sdk/lib/core/iterable.dart#newcode23 sdk/lib/core/iterable.dart:23: = _GeneratorIterable; Add TODO that we need to ...
7 years, 11 months ago (2013-01-08 13:02:54 UTC) #3
Lasse Reichstein Nielsen
https://codereview.chromium.org/11794044/diff/5/sdk/lib/core/iterable.dart File sdk/lib/core/iterable.dart (right): https://codereview.chromium.org/11794044/diff/5/sdk/lib/core/iterable.dart#newcode23 sdk/lib/core/iterable.dart:23: = _GeneratorIterable; My mistake, I thought it was implicitly ...
7 years, 11 months ago (2013-01-09 11:27:36 UTC) #4
Sean Eagan
7 years, 11 months ago (2013-01-09 14:15:20 UTC) #5
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/11794044/diff/10001/sdk/lib/core/itera...
File sdk/lib/core/iterable.dart (right):

https://chromiumcodereview.appspot.com/11794044/diff/10001/sdk/lib/core/itera...
sdk/lib/core/iterable.dart:22: factory Iterable.generate(int count, E
generator(int index)) {
Once we have a some way to get a integer range, I don't think we will need this
constructor:

range(10).mappedBy(f);

and then for Streams:

new Stream.fromIterable(range(10).mappedBy(f)); // or
new Stream.fromIterable(range(10)).mappedBy(f);

Powered by Google App Engine
This is Rietveld 408576698