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

Issue 1178793006: Add a StreamGroup class for merging streams. (Closed)

Created:
5 years, 6 months ago by nweiz
Modified:
5 years, 6 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/async.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 46

Patch Set 2 : Code review changes #

Total comments: 9

Patch Set 3 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+987 lines, -0 lines) Patch
M CHANGELOG.md View 1 chunk +3 lines, -0 lines 0 comments Download
M lib/async.dart View 1 chunk +1 line, -0 lines 0 comments Download
A lib/src/stream_group.dart View 1 2 1 chunk +259 lines, -0 lines 0 comments Download
A test/stream_group_test.dart View 1 2 1 chunk +724 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
nweiz
5 years, 6 months ago (2015-06-17 22:55:47 UTC) #2
Lasse Reichstein Nielsen
Looks good except I think there is a problem with single-sub streams in broadcast groups! ...
5 years, 6 months ago (2015-06-18 10:29:32 UTC) #3
nweiz
Code review changes
5 years, 6 months ago (2015-06-19 00:44:08 UTC) #4
nweiz
PTAL https://codereview.chromium.org/1178793006/diff/1/lib/src/stream_group.dart File lib/src/stream_group.dart (right): https://codereview.chromium.org/1178793006/diff/1/lib/src/stream_group.dart#newcode17 lib/src/stream_group.dart:17: /// [stream] will be a single-subscription stream for ...
5 years, 6 months ago (2015-06-19 00:44:18 UTC) #5
Lasse Reichstein Nielsen
Excellent! LGTM! https://codereview.chromium.org/1178793006/diff/20001/lib/src/stream_group.dart File lib/src/stream_group.dart (right): https://codereview.chromium.org/1178793006/diff/20001/lib/src/stream_group.dart#newcode25 lib/src/stream_group.dart:25: /// may drop events if a listener ...
5 years, 6 months ago (2015-06-19 12:45:13 UTC) #6
nweiz
Code review changes
5 years, 6 months ago (2015-06-19 20:01:11 UTC) #7
nweiz
Committed patchset #3 (id:40001) manually as 04a8d2e7379790fe85a0894dbb9ac94b0c2231c4 (presubmit successful).
5 years, 6 months ago (2015-06-19 20:01:32 UTC) #8
nweiz
5 years, 6 months ago (2015-06-19 20:02:03 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1178793006/diff/20001/lib/src/stream_group.dart
File lib/src/stream_group.dart (right):

https://codereview.chromium.org/1178793006/diff/20001/lib/src/stream_group.da...
lib/src/stream_group.dart:25: /// may drop events if a listener is added and
later removed.** Broadcast
On 2015/06/19 12:45:13, Lasse Reichstein Nielsen wrote:
> -> may drop events that arrive while [stream] has no listener
> ?

I think that's less accurate, since events *won't* be dropped when it first has
no listener, only later on when the last listener is removed.

https://codereview.chromium.org/1178793006/diff/20001/lib/src/stream_group.da...
lib/src/stream_group.dart:137: for (var stream in _subscriptions.keys.toList())
{
On 2015/06/19 12:45:13, Lasse Reichstein Nielsen wrote:
> You don't need to do toList (or avoid forEach).
> Updating the value of an existing key is not a modification that breaks
> iteration - only changing the key-set does that.

Done.

https://codereview.chromium.org/1178793006/diff/20001/lib/src/stream_group.da...
lib/src/stream_group.dart:183: for (var stream in _subscriptions.keys.toList())
{
On 2015/06/19 12:45:13, Lasse Reichstein Nielsen wrote:
> Ditto here, no need for toList.

Done.

https://codereview.chromium.org/1178793006/diff/20001/test/stream_group_test....
File test/stream_group_test.dart (right):

https://codereview.chromium.org/1178793006/diff/20001/test/stream_group_test....
test/stream_group_test.dart:407: await flushMicrotasks();
On 2015/06/19 12:45:13, Lasse Reichstein Nielsen wrote:
> Maybe check that the single-sub stream is canceled when it's removed.

Done.

Powered by Google App Engine
This is Rietveld 408576698