You are here

function each_limit in Lockr 7.3

Like each, 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:

callable $onFulfilled:

callable $onRejected:

Return value

PromiseInterface

1 call to each_limit()
each_limit_all in vendor/guzzlehttp/promises/src/functions.php
Like each_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/functions.php, line 372

Namespace

GuzzleHttp\Promise

Code

function each_limit($iterable, $concurrency, callable $onFulfilled = null, callable $onRejected = null) {
  return (new EachPromise($iterable, [
    'fulfilled' => $onFulfilled,
    'rejected' => $onRejected,
    'concurrency' => $concurrency,
  ]))
    ->promise();
}