A deferred is an internal structure for creating Futures. Because deferred is an imperative structure, users should instead construct futures through the Task structure.
This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.
A deferred is an internal structure for creating Futures. Because deferred is an imperative structure, users should instead construct futures through the Task structure.
A container for methods of Deferreds.
An array of visitors providing functions to be ran when the deferred's state changes.
The current state of the deferred, as an ExecutionState.
Returns a textual description of the object.
Returns a textual description of the object.
Adds a visitor to be invoked when the deferred's state changes.
Resolves a deferred with a cancellation value.
Resolves a deferred with a cancellation value, but doesn't throw if the deferred has already been resolved.
Resolves a deferred with a failure value.
Resolves a deferred successfully with a value.
function Deferred() {
define(this, '_state', Pending());
define(this, '_listeners', []);
}