| Index: lib/src/io.dart
|
| diff --git a/lib/src/io.dart b/lib/src/io.dart
|
| index d24ede0203bd1b4c4aaebdd722e5bd904515ce3e..116dc11ecd01a0973a34eeebf14bc3df28dc1ddf 100644
|
| --- a/lib/src/io.dart
|
| +++ b/lib/src/io.dart
|
| @@ -829,47 +829,6 @@ _doProcess(Function fn, String executable, List<String> args,
|
| environment: environment);
|
| }
|
|
|
| -/// Wraps [input], an asynchronous network operation to provide a timeout.
|
| -///
|
| -/// If [input] completes before [milliseconds] have passed, then the return
|
| -/// value completes in the same way. However, if [milliseconds] pass before
|
| -/// [input] has completed, it completes with a [TimeoutException] with
|
| -/// [description] (which should be a fragment describing the action that timed
|
| -/// out).
|
| -///
|
| -/// [url] is the URL being accessed asynchronously.
|
| -///
|
| -/// Note that timing out will not cancel the asynchronous operation behind
|
| -/// [input].
|
| -Future timeout(Future input, int milliseconds, Uri url, String description) {
|
| - // TODO(nwiez): Replace this with [Future.timeout].
|
| - var completer = new Completer();
|
| - var duration = new Duration(milliseconds: milliseconds);
|
| - var timer = new Timer(duration, () {
|
| - // Include the duration ourselves in the message instead of passing it to
|
| - // TimeoutException since we show nicer output.
|
| - var message = 'Timed out after ${niceDuration(duration)} while '
|
| - '$description.';
|
| -
|
| - if (url.host == "pub.dartlang.org" ||
|
| - url.host == "storage.googleapis.com") {
|
| - message += "\nThis is likely a transient error. Please try again later.";
|
| - }
|
| -
|
| - completer.completeError(new TimeoutException(message), new Chain.current());
|
| - });
|
| - input.then((value) {
|
| - if (completer.isCompleted) return;
|
| - timer.cancel();
|
| - completer.complete(value);
|
| - }).catchError((e, stackTrace) {
|
| - if (completer.isCompleted) return;
|
| - timer.cancel();
|
| - completer.completeError(e, stackTrace);
|
| - });
|
| - return completer.future;
|
| -}
|
| -
|
| /// Creates a temporary directory and passes its path to [fn].
|
| ///
|
| /// Once the [Future] returned by [fn] completes, the temporary directory and
|
|
|