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

Issue 12393009: Change and structure how Stream implementations do callbacks. (Closed)

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

Description

Change and structure how Stream implementations do callbacks. Callbacks are the on-pause/subscription-state change calls from a stream. Now a callback is an atomic operation. State changes happening during a callback will not trigger a new callback before the old one is done. If the state is changed during the callback, another callback will follow immediately. Firing of events is also atomic, so a callback will not happend during an event being fired, but will be triggered afterwards if the state was changed by the event handlers. A stream controller (or any other listener for callbacks) will not be told immediately if a paused stream is resumed. If there are pending events in the queue, those will be fired before the controller is considerered resumed. A canceled subscription will immediately stop getting events. Previously it would get the current event being fired, but it's more rational to not get events after you have said you don't want them, instead of having the handlers have to discard events after a cancel. Committed: https://code.google.com/p/dart/source/detail?r=19379

Patch Set 1 #

Total comments: 23

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+774 lines, -114 lines) Patch
M sdk/lib/async/async_error.dart View 1 chunk +8 lines, -9 lines 0 comments Download
M sdk/lib/async/stream.dart View 1 1 chunk +8 lines, -2 lines 0 comments Download
M sdk/lib/async/stream_controller.dart View 1 2 chunks +27 lines, -1 line 0 comments Download
M sdk/lib/async/stream_impl.dart View 1 29 chunks +223 lines, -102 lines 0 comments Download
A tests/lib/async/stream_state_test.dart View 1 1 chunk +508 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein Nielsen
7 years, 9 months ago (2013-03-01 13:58:46 UTC) #1
floitsch
LGTM. But the Stream implementation is still way too complex. Let's discuss on Monday if ...
7 years, 9 months ago (2013-03-01 21:52:30 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/12393009/diff/1/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/12393009/diff/1/sdk/lib/async/stream.dart#newcode25 sdk/lib/async/stream.dart:25: * is canceled, it immediately stops receiveing events. On ...
7 years, 9 months ago (2013-03-04 11:53:02 UTC) #3
Lasse Reichstein Nielsen
7 years, 9 months ago (2013-03-04 11:53:24 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 manually as r19379 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698