Home

# Class goog.async.DeferredList

Constructs an object that waits on the results of multiple asynchronous operations and marshals the results. It is itself a `Deferred`, and sends results to its registered callback chain. Each instance is single use and may only fire once. Unless overridden by one of the options below, the `DeferredList` will wait for a result from every input `Deferred`. The results are stored in a list of two-element arrays as `[success, result]`, where `success` is whether that result was from a callback or errback. Once all results are available, the `DeferredList`'s callback chain is invoked with the full result list.

extends goog.async.Deferred

Instance Method Summary
| `errback(<Any Type> result)` Record that this operation failed with an error, and send the error to all registered errback functions.
| `handleCallback_(number index, boolean success, <Any Type> result) ⇒ <Any Type>` Registers the result from an input deferred callback or errback. The result is returned and may be passed to additional handlers in the callback chain.

Static Method Summary
| `gatherResults(!Array list) ⇒ !goog.async.DeferredList` Creates a `DeferredList` that gathers results from multiple `Deferred` inputs. If all inputs succeed, the callback is fired with the list of results as a flat array. If any input fails, the errback is fired with the error.