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

Breadcrumb

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

function Utils::settle

Returns a promise that is fulfilled when all of the provided promises have been fulfilled or rejected.

The returned promise is fulfilled with an array of inspection state arrays.

Parameters

mixed $promises Promises or values.:

See also

inspect for the inspection state array format.

File

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

Class

Utils

Namespace

GuzzleHttp\Promise

Code

public static function settle($promises) : PromiseInterface {
    $results = [];
    return Each::of($promises, function ($value, $idx) use (&$results) : void {
        $results[$idx] = [
            'state' => PromiseInterface::FULFILLED,
            'value' => $value,
        ];
    }, function ($reason, $idx) use (&$results) : void {
        $results[$idx] = [
            'state' => PromiseInterface::REJECTED,
            'reason' => $reason,
        ];
    })->then(function () use (&$results) {
        ksort($results);
        return $results;
    });
}

API Navigation

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