Open Monograph Press  3.3.0
GuzzleHttp\Promise\EachPromise Class Reference
Inheritance diagram for GuzzleHttp\Promise\EachPromise:
GuzzleHttp\Promise\PromisorInterface

Public Member Functions

 __construct ($iterable, array $config=[])
 
 promise ()
 

Detailed Description

Represents a promise that iterates over many promises and invokes side-effect functions in the process.

Definition at line 8 of file EachPromise.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Promise\EachPromise::__construct (   $iterable,
array  $config = [] 
)

Configuration hash can include the following key value pairs:

  • fulfilled: (callable) Invoked when a promise fulfills. The function is invoked with three arguments: the fulfillment value, the index position from the iterable list of the promise, and the aggregate promise that manages all of the promises. The aggregate promise may be resolved from within the callback to short-circuit the promise.
  • rejected: (callable) Invoked when a promise is rejected. The function is invoked with three arguments: the rejection reason, the index position from the iterable list of the promise, and the aggregate promise that manages all of the promises. The aggregate promise may be resolved from within the callback to short-circuit the promise.
  • concurrency: (integer) Pass this configuration option to limit the allowed number of outstanding concurrently executing promises, creating a capped pool of promises. There is no limit by default.
Parameters
mixed$iterablePromises or values to iterate.
array$configConfiguration options

Definition at line 69 of file EachPromise.php.

References GuzzleHttp\Promise\iter_for().

Member Function Documentation

◆ promise()

GuzzleHttp\Promise\EachPromise::promise ( )

Returns a promise.

Returns
PromiseInterface

Implements GuzzleHttp\Promise\PromisorInterface.

Definition at line 86 of file EachPromise.php.


The documentation for this class was generated from the following file: