Copied!

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

  • final
CloneableInstantiable
Methods
public __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.
  • param mixed $iterable Promises or values to iterate.
  • param array $config Configuration options
public promise() : GuzzleHttp\Promise\PromiseInterface
 
  • psalm-suppress InvalidNullableReturnType
Properties
private $aggregate = NULL
 
  • var \Promise|null
private $concurrency = NULL
 
  • var callable|int|null
private $iterable = NULL
 
  • var \Iterator|null
private $mutex = NULL
 
  • var bool|null
private $nextPendingIndex = 0
private $onFulfilled = NULL
 
  • var callable|null
private $onRejected = NULL
 
  • var callable|null
private $pending = []
Methods
private addPending() : bool
private advanceIterator() : bool
private checkIfFinished() : bool
private createPromise() : void
private refillPending() : void
private step(int $idx) : void
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration