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

Breadcrumb

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

function Utils::unwrap

Waits on all of the provided promises and returns the fulfilled values.

Returns an array that contains the value of each promise (in the same order the promises were provided). An exception is thrown if any of the promises are rejected.

Parameters

iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.:

Throws

\Throwable on error

File

vendor/guzzlehttp/promises/src/Utils.php, line 117

Class

Utils

Namespace

GuzzleHttp\Promise

Code

public static function unwrap($promises) : array {
    $results = [];
    foreach ($promises as $key => $promise) {
        $results[$key] = $promise->wait();
    }
    return $results;
}

API Navigation

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