Chromium Code Reviews| Index: sdk/lib/async/future.dart |
| diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart |
| index 593a775d7f59461f7cda8dcc6cacabb4b316faae..1c273174ffda0504d560880de2b4be5ccd0d037d 100644 |
| --- a/sdk/lib/async/future.dart |
| +++ b/sdk/lib/async/future.dart |
| @@ -408,6 +408,17 @@ abstract class Future<T> { |
| * its subscribers. The stream closes after the completion value. |
| */ |
| Stream<T> asStream(); |
| + |
| + /** |
| + * Time-out the future computation after [timeLimit] has passed. |
| + * |
| + * Returns a new future that completes with the same value as this future, |
| + * if this future completes in time. |
| + * If this future does not complete before `timeLimit` has passed, |
|
floitsch
2013/11/27 12:31:16
New line before?
Lasse Reichstein Nielsen
2013/11/27 12:54:20
Done.
|
| + * the [onTimeout] action is executed instead, and its result (whether it |
| + * returns or thorws) is used as the result of the returned future. |
|
floitsch
2013/11/27 12:31:16
throws
Lasse Reichstein Nielsen
2013/11/27 12:54:20
Done.
|
| + */ |
| + Future timeout(Duration timeLimit, onTimeout()); |
|
floitsch
2013/11/27 12:31:16
I think onTimeout should be optional.
Lasse Reichstein Nielsen
2013/11/27 12:54:20
Done.
|
| } |
| /** |