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

Breadcrumb

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

function Each::ofLimit

Like of, but only allows a certain number of outstanding promises at any given time.

$concurrency may be an integer or a function that accepts the number of pending promises and returns a numeric concurrency limit value to allow for dynamic a concurrency size.

Parameters

mixed $iterable:

int|callable $concurrency:

1 call to Each::ofLimit()
Each::ofLimitAll in vendor/guzzlehttp/promises/src/Each.php
Like limit, but ensures that no promise in the given $iterable argument is rejected. If any promise is rejected, then the aggregate promise is rejected with the encountered rejection.

File

vendor/guzzlehttp/promises/src/Each.php, line 46

Class

Each

Namespace

GuzzleHttp\Promise

Code

public static function ofLimit($iterable, $concurrency, ?callable $onFulfilled = null, ?callable $onRejected = null) : PromiseInterface {
    return (new EachPromise($iterable, [
        'fulfilled' => $onFulfilled,
        'rejected' => $onRejected,
        'concurrency' => $concurrency,
    ]))->promise();
}

API Navigation

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