function Promise::invokeWaitFn
1 call to Promise::invokeWaitFn()
- Promise::waitIfPending in vendor/
guzzlehttp/ promises/ src/ Promise.php
File
-
vendor/
guzzlehttp/ promises/ src/ Promise.php, line 246
Class
- Promise
- Promises/A+ implementation that avoids recursion when possible.
Namespace
GuzzleHttp\PromiseCode
private function invokeWaitFn() : void {
try {
$wfn = $this->waitFn;
$this->waitFn = null;
$wfn(true);
} catch (\Throwable $reason) {
if ($this->state === self::PENDING) {
// The promise has not been resolved yet, so reject the promise
// with the exception.
$this->reject($reason);
}
else {
// The promise was already resolved, so there's a problem in
// the application.
throw $reason;
}
}
}