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

Unified Diff: packages/quiver/lib/src/async/future_group.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/quiver/lib/src/async/enumerate.dart ('k') | packages/quiver/lib/src/async/future_stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/quiver/lib/src/async/future_group.dart
diff --git a/packages/quiver/lib/src/async/future_group.dart b/packages/quiver/lib/src/async/future_group.dart
index c96ee1a3b7d525116bfa8d6e8d678d862888838f..65a6d3cad6428e8a2b72ff3c70921068eef74160 100644
--- a/packages/quiver/lib/src/async/future_group.dart
+++ b/packages/quiver/lib/src/async/future_group.dart
@@ -14,13 +14,16 @@
part of quiver.async;
-/**
- * A collection of [Future]s that signals when all added Futures complete. New
- * Futures can be added to the group as long as it hasn't completed.
- *
- * FutureGroup is useful for managing a set of async tasks that may spawn new
- * async tasks as they execute.
- */
+/// A collection of [Future]s that signals when all added Futures complete. New
+/// Futures can be added to the group as long as it hasn't completed.
+///
+/// FutureGroup is useful for managing a set of async tasks that may spawn new
+/// async tasks as they execute.
+///
+/// DEPRECATED: use `FutureGroup` from `package:async`. Note that it requires a
+/// `close()` call before auto-completion will be triggered upon the count of
+/// pending tasks dropping to 0.
+@deprecated
class FutureGroup<E> {
static const _FINISHED = -1;
@@ -29,18 +32,16 @@ class FutureGroup<E> {
final Completer<List> _completer = new Completer<List>();
final List results = [];
- /** Gets the task that failed, if any. */
+ /// Gets the task that failed, if any.
Future get failedTask => _failedTask;
- /**
- * Wait for [task] to complete.
- *
- * If this group has already been marked as completed, a [StateError] will be
- * thrown.
- *
- * If this group has a [failedTask], new tasks will be ignored, because the
- * error has already been signaled.
- */
+ /// Wait for [task] to complete.
+ ///
+ /// If this group has already been marked as completed, a [StateError] will
+ /// be thrown.
+ ///
+ /// If this group has a [failedTask], new tasks will be ignored, because the
+ /// error has already been signaled.
void add(Future task) {
if (_failedTask != null) return;
if (_pending == _FINISHED) throw new StateError("Future already completed");
@@ -63,12 +64,10 @@ class FutureGroup<E> {
});
}
- /**
- * A Future that complets with a List of the values from all the added
- * tasks, when they have all completed.
- *
- * If any task fails, this Future will receive the error. Only the first
- * error will be sent to the Future.
- */
+ /// A Future that complets with a List of the values from all the added
+ /// tasks, when they have all completed.
+ ///
+ /// If any task fails, this Future will receive the error. Only the first
+ /// error will be sent to the Future.
Future<List<E>> get future => _completer.future;
}
« no previous file with comments | « packages/quiver/lib/src/async/enumerate.dart ('k') | packages/quiver/lib/src/async/future_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698