\GuzzleHttp\PromiseEachPromise

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

Summary

Methods
Properties
Constants
__construct()
promise()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
createPromise()
refillPending()
addPending()
advanceIterator()
step()
checkIfFinished()
$pending
$nextPendingIndex
$iterable
$concurrency
$onFulfilled
$onRejected
$aggregate
$mutex
N/A

Properties

$pending

$pending

$nextPendingIndex

$nextPendingIndex

$onFulfilled

$onFulfilled : callable|null

Type

callable|null

$aggregate

$aggregate : \GuzzleHttp\Promise\Promise|null

Type

Promise|null

$mutex

$mutex : bool|null

Type

bool|null

Methods

__construct()

__construct(mixed  $iterable, array  $config = []) : mixed

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 $iterable

Promises or values to iterate.

array $config

Configuration options

Returns

mixed —

promise()

promise() : \GuzzleHttp\Promise\PromiseInterface

Returns a promise.

Returns

\GuzzleHttp\Promise\PromiseInterface —

createPromise()

createPromise() : mixed

Returns

mixed —

refillPending()

refillPending() : mixed

Returns

mixed —

addPending()

addPending() : mixed

Returns

mixed —

advanceIterator()

advanceIterator() : mixed

Returns

mixed —

step()

step(mixed  $idx) : mixed

Parameters

mixed $idx

Returns

mixed —

checkIfFinished()

checkIfFinished() : mixed

Returns

mixed —