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

Issue 18015002: Add package with iterable and stream "zipping" functionality. (Closed)

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

Description

Add package with iterable and stream "zipping" functionality. You can use new IterableZip([it1, it2, it3]) to generate an iterable of three-element lists, one from each source iterable, as long as all three source iterables have an element. Similar functionality for streams is provided by StreamZip. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=24835

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address review comments. More tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+526 lines, -4 lines) Patch
M pkg/pkg.status View 1 1 chunk +1 line, -0 lines 0 comments Download
A pkg/sequence_zip/lib/iterable_zip.dart View 1 1 chunk +56 lines, -0 lines 0 comments Download
A + pkg/sequence_zip/lib/sequence_zip.dart View 1 1 chunk +3 lines, -4 lines 0 comments Download
A pkg/sequence_zip/lib/stream_zip.dart View 1 1 chunk +116 lines, -0 lines 0 comments Download
A pkg/sequence_zip/pubspec.yaml View 1 chunk +9 lines, -0 lines 0 comments Download
A pkg/sequence_zip/test/iterable_test.dart View 1 chunk +112 lines, -0 lines 0 comments Download
A pkg/sequence_zip/test/stream_test.dart View 1 1 chunk +229 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
7 years, 6 months ago (2013-06-27 06:02:13 UTC) #1
Lasse Reichstein Nielsen
PTAL
7 years, 5 months ago (2013-07-04 11:40:38 UTC) #2
Lasse Reichstein Nielsen
PTAL
7 years, 5 months ago (2013-07-04 11:40:38 UTC) #3
floitsch
LGTM, but add test for pause/resume. https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/iterable_zip.dart File pkg/sequence_zip/lib/iterable_zip.dart (right): https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/iterable_zip.dart#newcode17 pkg/sequence_zip/lib/iterable_zip.dart:17: * [Iterable]'s [Iterator]. ...
7 years, 5 months ago (2013-07-04 14:31:22 UTC) #4
Lasse Reichstein Nielsen
Committed patchset #2 manually as r24835 (presubmit successful).
7 years, 5 months ago (2013-07-09 05:49:41 UTC) #5
Lasse Reichstein Nielsen
7 years, 5 months ago (2013-07-09 06:15:59 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/iterable...
File pkg/sequence_zip/lib/iterable_zip.dart (right):

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/iterable...
pkg/sequence_zip/lib/iterable_zip.dart:17: * [Iterable]'s [Iterator]. As soon as
any of the iterators run out.
On 2013/07/04 14:31:22, floitsch wrote:
> unfinished sentence.

Done.

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/stream_z...
File pkg/sequence_zip/lib/stream_zip.dart (right):

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/stream_z...
pkg/sequence_zip/lib/stream_zip.dart:45: /// is used insted.
On 2013/07/04 14:31:22, floitsch wrote:
> instead

Done.

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/stream_z...
pkg/sequence_zip/lib/stream_zip.dart:47: controller.addError(error);
No. I decided that an error is not a replacement for data. We are still waiting
for the data.

I really, really recommend using cancelOnError when using this in any case.

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/stream_z...
pkg/sequence_zip/lib/stream_zip.dart:90: // These will not be resumed by
onResume below, but must wait for the
Yes! I finally found a case where it is exactly what I needed!

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/lib/stream_z...
pkg/sequence_zip/lib/stream_zip.dart:97: subscriptions[i].pause();
Hmm. That does look like a failure of the testing.

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/test/stream_...
File pkg/sequence_zip/test/stream_test.dart (right):

https://codereview.chromium.org/18015002/diff/1/pkg/sequence_zip/test/stream_...
pkg/sequence_zip/test/stream_test.dart:93: Stream st2 = new
Stream.periodic(const Duration(milliseconds: 5),
I'll mark it as failing.

Powered by Google App Engine
This is Rietveld 408576698