GuzzleHttpPromiseeach_limit

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

Description

GuzzleHttp\Promise\each_limit( (mixed) $iterable, (int|callable) $concurrency, (constant) callable $onFulfilled = null, (null) callable $onRejected = null ); 

$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 (4)

0. $iterable (mixed)
The iterable.
1. $concurrency (int|callable)
The concurrency.
2. $onfulfilled — Optional. (constant) => callable $onFulfilled = null
The onfulfilled.
3. $onrejected — Optional. (null) => callable $onRejected = null
The onrejected.

Usage

  1. if ( !function_exists( 'GuzzleHttp\Promise\each_limit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/Promise/functions.php'; 
  3.  
  4. // The iterable. 
  5. $iterable = null; 
  6.  
  7. // The concurrency. 
  8. $concurrency = null; 
  9.  
  10. // The onfulfilled. 
  11. $onfulfilled = callable $onFulfilled = null; 
  12.  
  13. // The onrejected. 
  14. $onrejected = callable $onRejected = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = GuzzleHttp\Promise\each_limit($iterable, $concurrency, $onfulfilled, $onrejected); 
  18.  

Defined (1)

The function is defined in the following location(s).

/lib/Azure/GuzzleHttp/Promise/functions.php