PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
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 33 of file Promise.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 39 of file Promise.php.

Member Function Documentation

◆ all()

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

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.

Parameters
Promise[]$promises

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

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

Definition at line 77 of file Promise.php.

◆ isResolved()

pocketmine\promise\Promise::isResolved ( )

Definition at line 57 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 45 of file Promise.php.


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