Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Promise.php

function Promise::wait

Same name in this branch
  1. 11.1.x vendor/php-http/guzzle7-adapter/src/Promise.php \Http\Adapter\Guzzle7\Promise::wait()
  2. 11.1.x vendor/guzzlehttp/promises/src/Promise.php \GuzzleHttp\Promise\Promise::wait()

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.

Parameters

bool $unwrap Whether to return resolved value / throw reason or not:

Return value

($unwrap is true ? mixed : null) Resolved value, null if $unwrap is set to false

Throws

\Throwable the rejection reason if $unwrap is set to true and the request failed

5 methods override Promise::wait()
FulfilledPromise::wait in vendor/php-http/promise/src/FulfilledPromise.php
Wait for the promise to be fulfilled or rejected.
HttpFulfilledPromise::wait in vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php
Wait for the promise to be fulfilled or rejected.
HttpRejectedPromise::wait in vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php
Wait for the promise to be fulfilled or rejected.
Promise::wait in vendor/php-http/guzzle7-adapter/src/Promise.php
Wait for the promise to be fulfilled or rejected.
RejectedPromise::wait in vendor/php-http/promise/src/RejectedPromise.php
Wait for the promise to be fulfilled or rejected.

File

vendor/php-http/promise/src/Promise.php, line 68

Class

Promise
Promise represents a value that may not be available yet, but will be resolved at some point in future. It acts like a proxy to the actual value.

Namespace

Http\Promise

Code

public function wait($unwrap = true);

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal