Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (PromiseInterface $promise, RequestInterface $request) | |
getState () | |
then (callable $onFulfilled=null, callable $onRejected=null) | |
wait ($unwrap=true) | |
Additional Inherited Members | |
![]() | |
const | FULFILLED = 'fulfilled' |
const | PENDING = 'pending' |
const | REJECTED = 'rejected' |
Wrapper around Guzzle promises.
Definition at line 18 of file php-http/guzzle6-adapter/src/Promise.php.
Http\Adapter\Guzzle6\Promise::__construct | ( | PromiseInterface | $promise, |
RequestInterface | $request | ||
) |
PromiseInterface | $promise | |
RequestInterface | $request |
Definition at line 64 of file php-http/guzzle6-adapter/src/Promise.php.
References Http\Promise\Promise\FULFILLED, Http\Promise\Promise\PENDING, Http\Promise\Promise\REJECTED, and GuzzleHttp\Promise\PromiseInterface\then().
Http\Adapter\Guzzle6\Promise::getState | ( | ) |
{Returns the state of the promise, one of PENDING, FULFILLED or REJECTED.
Implements Http\Promise\Promise.
Definition at line 101 of file php-http/guzzle6-adapter/src/Promise.php.
Referenced by Http\Adapter\Guzzle6\Promise\wait().
Http\Adapter\Guzzle6\Promise::then | ( | callable | $onFulfilled = null , |
callable | $onRejected = null |
||
) |
{Adds behavior for when the promise is resolved or rejected (response will be available, or error happens).If you do not care about one of the cases, you can set the corresponding callable to null The callback will be called when the value arrived and never more than once.
callable | $onFulfilled | Called when a response will be available. |
callable | $onRejected | Called when an exception occurs. |
Implements Http\Promise\Promise.
Definition at line 93 of file php-http/guzzle6-adapter/src/Promise.php.
Http\Adapter\Guzzle6\Promise::wait | ( | $unwrap = true | ) |
{Wait for the promise to be fulfilled or rejected.When this method returns, the request has been resolved and if callables have been specified, the appropriate one has terminated.When $unwrap is true (the default), the response is returned, or the exception thrown on failure. Otherwise, nothing is returned or thrown.
bool | $unwrap | Whether to return resolved value / throw reason or not |
Implements Http\Promise\Promise.
Definition at line 109 of file php-http/guzzle6-adapter/src/Promise.php.
References Http\Adapter\Guzzle6\Promise\getState().