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

Breadcrumb

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

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\Promise

Code

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;
        }
    }
}

API Navigation

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