Amp\Deferred classDeferred

Deferred is a container for a promise that is resolved using the resolve() and fail() methods of this object.

The contained promise may be accessed using the promise() method. This object should not be part of a public API, but used internally to create and resolve a promise.

Summary

Properties

Methods

Properties

Methods

__construct —public function__construct()
No documentation.
promise —public functionpromise():Amp\Promise
No documentation.
resolve —public functionresolve(mixed$value =null)

Fulfill the promise with the given value.

Type Parameter Description Default Value
mixed $value No documentation. null
fail —public functionfail(Throwable$reason)

Fails the promise the the given reason.

Type Parameter Description Default Value
Throwable $reason No documentation. none
onResolve —public functiononResolve(callable$onResolved)
No documentation.
Type Parameter Description Default Value
callable $onResolved No documentation. none