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

Issue 96473003: Add Stream.timeout method. (Closed)

Created:
7 years ago by Lasse Reichstein Nielsen
Modified:
7 years ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : Add more tests. #

Patch Set 3 : Updated documentation. #

Total comments: 17

Patch Set 4 : Only acccept one parameter, no cancel. No zone.fork. #

Patch Set 5 : Use new TimeoutException #

Patch Set 6 : Update tests. #

Patch Set 7 : Changed zone behavior. #

Total comments: 5

Patch Set 8 : Document zone usage. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+270 lines, -1 line) Patch
M sdk/lib/async/stream.dart View 1 2 3 4 5 6 7 3 chunks +98 lines, -1 line 0 comments Download
A tests/lib/async/stream_timeout_test.dart View 1 2 3 4 5 1 chunk +171 lines, -0 lines 0 comments Download
M tests/lib/lib.status View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Lasse Reichstein Nielsen
7 years ago (2013-11-29 12:34:55 UTC) #1
floitsch
https://codereview.chromium.org/96473003/diff/40001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/96473003/diff/40001/sdk/lib/async/stream.dart#newcode978 sdk/lib/async/stream.dart:978: * If the `onTimeout` function accepts two arguments, it ...
7 years ago (2013-11-29 13:43:47 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/96473003/diff/40001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/96473003/diff/40001/sdk/lib/async/stream.dart#newcode978 sdk/lib/async/stream.dart:978: * If the `onTimeout` function accepts two arguments, it ...
7 years ago (2013-11-29 13:58:03 UTC) #3
floitsch
https://codereview.chromium.org/96473003/diff/40001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/96473003/diff/40001/sdk/lib/async/stream.dart#newcode1024 sdk/lib/async/stream.dart:1024: timer.cancel(); On 2013/11/29 13:58:03, Lasse Reichstein Nielsen wrote: > ...
7 years ago (2013-11-29 15:03:49 UTC) #4
Lasse Reichstein Nielsen
PTAL
7 years ago (2013-12-03 14:02:18 UTC) #5
floitsch
LGTM once the zones have been fixed. https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/stream.dart#newcode1005 sdk/lib/async/stream.dart:1005: zone = ...
7 years ago (2013-12-05 12:37:38 UTC) #6
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/stream.dart#newcode1005 sdk/lib/async/stream.dart:1005: zone = Zone.current; That is what we are doing ...
7 years ago (2013-12-05 13:28:43 UTC) #7
Lasse Reichstein Nielsen
Committed patchset #8 manually as r30895 (presubmit successful).
7 years ago (2013-12-05 13:32:41 UTC) #8
floitsch
Noticed a small issue. https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/stream.dart#newcode1005 sdk/lib/async/stream.dart:1005: zone = Zone.current; On 2013/12/05 ...
7 years ago (2013-12-05 14:20:49 UTC) #9
Lasse Reichstein Nielsen
7 years ago (2013-12-05 14:57:54 UTC) #10
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/str...
File sdk/lib/async/stream.dart (right):

https://chromiumcodereview.appspot.com/96473003/diff/110001/sdk/lib/async/str...
sdk/lib/async/stream.dart:1017: zone.runUnaryGuarded(onTimeout, wrapper);
I can see the point.
I actually preferred to have the onTimeout failure not show up in the stream,
because it should be considered a programming error (you can put errors into the
sink, so throwing isn't the right way to make an error).
On the other hand, it makes it harder to handle the error if you can't catch it
downstream, but need an error-zone for it.

Powered by Google App Engine
This is Rietveld 408576698