A promise represents the eventual result of an asynchronous operation.
The primary way of interacting with a promise is through its then method,
which registers callbacks to receive either a promise’s eventual value or
the reason why the promise cannot be fulfilled.
- see https://promisesaplus.com/
Constants |
public GuzzleHttp |
public GuzzleHttp |
public GuzzleHttp |
Methods |
public abstract cancel() : void Cancels the promise if possible.
|
public abstract getState() : string Get the state of the promise ("pending", "rejected", or "fulfilled"). The three states can be checked against the constants defined on |
public abstract otherwise(callable $onRejected) : GuzzleHttp Appends a rejection handler callback to the promise, and returns a new
|
public abstract reject( $reason) : void Reject the promise with the given reason.
|
public abstract resolve( $value) : void Resolve the promise with the given value.
|
public abstract then(?callable $onFulfilled = NULL, ?callable $onRejected = NULL) : GuzzleHttp Appends fulfillment and rejection handlers to the promise, and returns
|
public abstract wait(bool $unwrap = true) Waits until the promise completes if possible. Pass $unwrap as true to unwrap the result of the promise, either If the promise cannot be waited on, then the promise will be rejected.
|