function Promise::wait
Same name in this branch
- 11.1.x vendor/php-http/guzzle7-adapter/src/Promise.php \Http\Adapter\Guzzle7\Promise::wait()
- 11.1.x vendor/php-http/promise/src/Promise.php \Http\Promise\Promise::wait()
Overrides PromiseInterface::wait
File
-
vendor/
guzzlehttp/ promises/ src/ Promise.php, line 67
Class
- Promise
- Promises/A+ implementation that avoids recursion when possible.
Namespace
GuzzleHttp\PromiseCode
public function wait(bool $unwrap = true) {
$this->waitIfPending();
if ($this->result instanceof PromiseInterface) {
return $this->result
->wait($unwrap);
}
if ($unwrap) {
if ($this->state === self::FULFILLED) {
return $this->result;
}
// It's rejected so "unwrap" and throw an exception.
throw Create::exceptionFor($this->result);
}
}