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

Issue 1610443002: Add StreamChannel and MultiChannel. (Closed)

Created:
4 years, 11 months ago by nweiz
Modified:
4 years, 11 months ago
Reviewers:
Bob Nystrom, kevmoo
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/stream_channel.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add StreamChannel and MultiChannel. These are exact copies of the classes and tests from the test package. R=rnystrom@google.com, kevmoo@google.com Committed: https://github.com/dart-lang/stream_channel/commit/21d98c9a548a6e343ebfe820da64db024b23d2b4

Patch Set 1 #

Total comments: 11

Patch Set 2 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+624 lines, -0 lines) Patch
A lib/src/multi_channel.dart View 1 1 chunk +244 lines, -0 lines 0 comments Download
A lib/stream_channel.dart View 1 chunk +50 lines, -0 lines 0 comments Download
A test/multi_channel_test.dart View 1 chunk +310 lines, -0 lines 0 comments Download
A test/utils.dart View 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
nweiz
4 years, 11 months ago (2016-01-20 00:50:55 UTC) #1
Bob Nystrom
lgtm https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart File lib/src/multi_channel.dart (right): https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart#newcode73 lib/src/multi_channel.dart:73: VirtualChannel virtualChannel([id]); How about just calling these "channels"? ...
4 years, 11 months ago (2016-01-21 00:06:30 UTC) #3
nweiz
https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart File lib/src/multi_channel.dart (right): https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart#newcode73 lib/src/multi_channel.dart:73: VirtualChannel virtualChannel([id]); On 2016/01/21 00:06:30, Bob Nystrom wrote: > ...
4 years, 11 months ago (2016-01-21 00:34:35 UTC) #4
Bob Nystrom
https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart File lib/src/multi_channel.dart (right): https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart#newcode73 lib/src/multi_channel.dart:73: VirtualChannel virtualChannel([id]); On 2016/01/21 00:34:35, nweiz wrote: > > ...
4 years, 11 months ago (2016-01-21 00:38:30 UTC) #5
nweiz
Code review changes
4 years, 11 months ago (2016-01-21 01:02:15 UTC) #6
nweiz
Committed patchset #2 (id:20001) manually as 21d98c9a548a6e343ebfe820da64db024b23d2b4 (presubmit successful).
4 years, 11 months ago (2016-01-21 01:02:24 UTC) #8
nweiz
4 years, 11 months ago (2016-01-21 01:05:55 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart
File lib/src/multi_channel.dart (right):

https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart#...
lib/src/multi_channel.dart:73: VirtualChannel virtualChannel([id]);
On 2016/01/21 00:38:30, Bob Nystrom wrote:
> On 2016/01/21 00:34:35, nweiz wrote:
> > > Also can id be typed?
> > 
> > I'd prefer not to make any guarantees about the type of IDs we use in the
API.
> > From the user's perspective, the only important thing about them is that
> they're
> > JSON-safe.
> 
> In _MultiChannel.virtualChannel(), don't you assume it's an int if it isn't
> null?

Yes, but that's still an implementation detail. The user knows where the ID will
be in a message, and they provide whatever's there regardless of its type to
this method. Internally, we know it'll be an int, but we don't guarantee that to
the user.

https://codereview.chromium.org/1610443002/diff/1/lib/src/multi_channel.dart#...
lib/src/multi_channel.dart:200: // closed.
On 2016/01/21 00:38:30, Bob Nystrom wrote:
> On 2016/01/21 00:34:35, nweiz wrote:
> > On 2016/01/21 00:06:30, Bob Nystrom wrote:
> > > Move this comment down.
> > 
> > I'm not sure why or where. All of the logic in the method body relates to
> > shutting down the virtual channel.
> 
> I meant down to the _innerSink.add() call. Isn't that where you're sending a
> message without data?

Done.

Powered by Google App Engine
This is Rietveld 408576698