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
Namespace
GuzzleHttp\PromiseCode
public static function ofLimit($iterable, $concurrency, ?callable $onFulfilled = null, ?callable $onRejected = null) : PromiseInterface {
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
'rejected' => $onRejected,
'concurrency' => $concurrency,
]))->promise();
}