GuzzleHttpPromisesome

Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises).

Description

GuzzleHttp\Promise\some( (number) $count, (mixed) $promises ); 

When count amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution.

This prommise is rejected with a if the number of fulfilled promises is less than the desired $count.

Parameters (2)

0. $count (number)
Total number of promises.
1. $promises (mixed)
Promises or values.

Usage

  1. if ( !function_exists( 'GuzzleHttp\Promise\some' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/Promise/functions.php'; 
  3.  
  4. // Total number of promises. 
  5. $count = null; 
  6.  
  7. // Promises or values. 
  8. $promises = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = GuzzleHttp\Promise\some($count, $promises); 
  12.  

Defined (1)

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

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