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

Issue 18915008: Let StreamSubscription.cancel return a Future. (Closed)

Created:
7 years, 5 months ago by Anders Johnsen
Modified:
7 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Let StreamSubscription.cancel return a Future. This gives the ability mark a subscription cancel as asynchrouns. Thiw now means that StreamController's onCancel takes either a value (null in most cases) and a Future, just like 'new Future(() => value)'. BUG= R=floitsch@google.com, lrn@google.com Committed: https://code.google.com/p/dart/source/detail?r=28925

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 16

Patch Set 3 : Clean up patch. #

Patch Set 4 : Remove dir stuff. #

Total comments: 60

Patch Set 5 : Review changes. #

Patch Set 6 : Fix type. #

Total comments: 14

Patch Set 7 : Clean up comments and delay done future. #

Patch Set 8 : Mark failing tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+399 lines, -141 lines) Patch
M sdk/lib/_internal/pub/pub.status View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M sdk/lib/async/stream.dart View 1 2 3 4 5 6 16 chunks +31 lines, -33 lines 0 comments Download
M sdk/lib/async/stream_controller.dart View 1 2 3 4 5 6 10 chunks +28 lines, -16 lines 0 comments Download
M sdk/lib/async/stream_impl.dart View 1 2 3 4 5 6 12 chunks +77 lines, -33 lines 0 comments Download
M sdk/lib/async/stream_pipe.dart View 1 2 3 4 1 chunk +28 lines, -5 lines 0 comments Download
M tests/lib/async/stream_controller_async_test.dart View 1 2 3 4 5 6 8 chunks +16 lines, -16 lines 0 comments Download
M tests/lib/async/stream_state_nonzero_timer_test.dart View 1 2 3 4 5 chunks +10 lines, -10 lines 0 comments Download
M tests/lib/async/stream_state_test.dart View 1 2 3 4 7 chunks +66 lines, -28 lines 0 comments Download
A tests/lib/async/stream_subscription_cancel_test.dart View 1 2 3 4 1 chunk +138 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Anders Johnsen
This is limited changed that shows how the Stream methods would be implemented, and how ...
7 years, 5 months ago (2013-07-12 13:16:22 UTC) #1
floitsch
FYI. https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart#newcode350 sdk/lib/async/stream.dart:350: subscription.cancel().whenComplete(() { Why `whenComplete` if `cancel` is guaranteed ...
7 years, 5 months ago (2013-07-12 16:42:34 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart#newcode350 sdk/lib/async/stream.dart:350: subscription.cancel().whenComplete(() { Why would that cost more?
7 years, 5 months ago (2013-07-16 12:03:31 UTC) #3
floitsch
https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart#newcode350 sdk/lib/async/stream.dart:350: subscription.cancel().whenComplete(() { On 2013/07/16 12:03:31, Lasse Reichstein Nielsen wrote: ...
7 years, 5 months ago (2013-07-16 12:47:17 UTC) #4
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/18915008/diff/2001/sdk/lib/async/stream.dart#newcode878 sdk/lib/async/stream.dart:878: * In case the cancel is asynchronous, the ...
7 years, 5 months ago (2013-07-17 07:28:46 UTC) #5
Anders Johnsen
PTAL, and ignore old comments as this is pretty much a rewrite due to changes ...
7 years, 2 months ago (2013-10-11 12:32:39 UTC) #6
floitsch
Mostly LGTM, but I think we will have to discuss this again in person... https://codereview.chromium.org/18915008/diff/15001/sdk/lib/async/stream.dart ...
7 years, 2 months ago (2013-10-12 18:53:56 UTC) #7
Lasse Reichstein Nielsen
LGTM with more tests. In my experience, only exhaustive tests can convince me that something ...
7 years, 2 months ago (2013-10-14 11:32:33 UTC) #8
Anders Johnsen
PTAL Added some more tests, but I'm not 100% sure it's the right approach in ...
7 years, 2 months ago (2013-10-16 11:52:20 UTC) #9
floitsch
LGTM. if possible wait for Lasse's comments on the tests. https://codereview.chromium.org/18915008/diff/15001/sdk/lib/async/stream_controller.dart File sdk/lib/async/stream_controller.dart (right): https://codereview.chromium.org/18915008/diff/15001/sdk/lib/async/stream_controller.dart#newcode580 ...
7 years, 2 months ago (2013-10-16 14:43:44 UTC) #10
Anders Johnsen
Thanks for the comments on the comments! PTAL, Lasse, do you have further comments for ...
7 years, 2 months ago (2013-10-21 08:01:45 UTC) #11
Anders Johnsen
7 years, 2 months ago (2013-10-21 12:09:51 UTC) #12
Message was sent while issue was closed.
Committed patchset #8 manually as r28925 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698