Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 247 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

EachPromise:: (8 methods):
  __construct()
  promise()
  createPromise()
  refillPending()
  addPending()
  advanceIterator()
  step()
  checkIfFinished()


Class: EachPromise  - X-Ref

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

__construct($iterable, array $config = [])   X-Ref
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

promise()   X-Ref
No description

createPromise()   X-Ref


refillPending()   X-Ref
No description

addPending()   X-Ref
No description

advanceIterator()   X-Ref
No description

step($idx)   X-Ref
No description

checkIfFinished()   X-Ref
No description