PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\promise\Promise Class Reference
+ Collaboration diagram for pocketmine\promise\Promise:

Public Member Functions

 __construct (private PromiseSharedData $shared)
 isResolved ()
 onCompletion (\Closure $onSuccess, \Closure $onFailure)

Static Public Member Functions

static all (array $promises)

Detailed Description

@phpstan-template TValue

Definition at line 32 of file Promise.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\promise\Promise::__construct ( private PromiseSharedData  $shared)

Definition at line 38 of file Promise.php.

Member Function Documentation

◆ all()

static pocketmine\promise\Promise::all ( array  $promises)

Returns a promise that will resolve only once all the Promises in $promises have resolved. The resolution value of the returned promise will be an array containing the resolution values of each Promises in $promises indexed by the respective Promises' array keys.


@phpstan-template TPromiseValue @phpstan-template TKey of array-key @phpstan-param non-empty-array<TKey, Promise<TPromiseValue>> $promises

@phpstan-return Promise<array<TKey, TPromiseValue>>

Definition at line 76 of file Promise.php.

◆ isResolved()

pocketmine\promise\Promise::isResolved ( )

Definition at line 56 of file Promise.php.

◆ onCompletion()

pocketmine\promise\Promise::onCompletion ( \Closure  $onSuccess,
\Closure  $onFailure 

@phpstan-param \Closure(TValue) : void $onSuccess @phpstan-param \Closure() : void $onFailure

Definition at line 44 of file Promise.php.

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