PHP Трейт Kraken\Promise\Partial\PromiseTrait

Показать файл Открыть проект

Открытые методы

Метод Описание
all ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues ) : Kraken\Promise\PromiseInterface Return Promise that will resolve only once all the items in $promisesOrValues have resolved.
any ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues ) : Kraken\Promise\PromiseInterface Return a promise that will resolve when any one of the items in $promisesOrValues resolves.
doCancel ( Kraken\Promise\PromiseInterface | mixed $promiseOrValue = null ) : Kraken\Promise\PromiseInterface Cancel Promise or value.
doReject ( Kraken\Promise\PromiseInterface | mixed $promiseOrValue = null ) : Kraken\Promise\PromiseInterface Reject Promise or value.
doResolve ( Kraken\Promise\PromiseInterface | mixed $promiseOrValue = null ) : Kraken\Promise\PromiseInterface Resolve Promise or value.
map ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues, callable $mapFunc ) : Kraken\Promise\PromiseInterface Map promises and/or values using specified $mapFunc.
race ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues ) : Kraken\Promise\PromiseInterface Initiate a competitive race that allows one winner.
reduce ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues, callable $reduceFunc, Kraken\Promise\PromiseInterface | mixed | null $initialValue = null ) : Kraken\Promise\PromiseInterface Reduce Promises and/or values using $reduceFunc with $initialValue being Promise or primitive value.
some ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues, integer $howMany ) : Kraken\Promise\PromiseInterface Return Promise that will resolve when $howMany of the supplied items in $promisesOrValues resolve.

Описание методов

all() публичный статический Метод

Return Promise that will resolve only once all the items in $promisesOrValues have resolved. The resolution value of the returned promise will be an array containing the resolution values of each of the items in $promisesOrValues.
public static all ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues ) : Kraken\Promise\PromiseInterface
$promisesOrValues Kraken\Promise\PromiseInterface[] | mixed[]
Результат Kraken\Promise\PromiseInterface

any() публичный статический Метод

Return a promise that will resolve when any one of the items in $promisesOrValues resolves. The resolution value of the returned promise will be the resolution value of the triggering item.
public static any ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues ) : Kraken\Promise\PromiseInterface
$promisesOrValues Kraken\Promise\PromiseInterface[] | mixed[]
Результат Kraken\Promise\PromiseInterface

doCancel() публичный статический Метод

Cancel Promise or value.
public static doCancel ( Kraken\Promise\PromiseInterface | mixed $promiseOrValue = null ) : Kraken\Promise\PromiseInterface
$promiseOrValue Kraken\Promise\PromiseInterface | mixed
Результат Kraken\Promise\PromiseInterface

doReject() публичный статический Метод

Reject Promise or value.
public static doReject ( Kraken\Promise\PromiseInterface | mixed $promiseOrValue = null ) : Kraken\Promise\PromiseInterface
$promiseOrValue Kraken\Promise\PromiseInterface | mixed
Результат Kraken\Promise\PromiseInterface

doResolve() публичный статический Метод

Resolve Promise or value.
public static doResolve ( Kraken\Promise\PromiseInterface | mixed $promiseOrValue = null ) : Kraken\Promise\PromiseInterface
$promiseOrValue Kraken\Promise\PromiseInterface | mixed
Результат Kraken\Promise\PromiseInterface

map() публичный статический Метод

Map promises and/or values using specified $mapFunc.
См. также: array_map
public static map ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues, callable $mapFunc ) : Kraken\Promise\PromiseInterface
$promisesOrValues Kraken\Promise\PromiseInterface[] | mixed[]
$mapFunc callable
Результат Kraken\Promise\PromiseInterface

race() публичный статический Метод

Initiate a competitive race that allows one winner. Returns a promise which is resolved in the same way the first settled promise resolves.
public static race ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues ) : Kraken\Promise\PromiseInterface
$promisesOrValues Kraken\Promise\PromiseInterface[] | mixed[]
Результат Kraken\Promise\PromiseInterface

reduce() публичный статический Метод

Reduce Promises and/or values using $reduceFunc with $initialValue being Promise or primitive value.
См. также: array_reduce
public static reduce ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues, callable $reduceFunc, Kraken\Promise\PromiseInterface | mixed | null $initialValue = null ) : Kraken\Promise\PromiseInterface
$promisesOrValues Kraken\Promise\PromiseInterface[] | mixed[]
$reduceFunc callable
$initialValue Kraken\Promise\PromiseInterface | mixed | null
Результат Kraken\Promise\PromiseInterface

some() публичный статический Метод

Return Promise that will resolve when $howMany of the supplied items in $promisesOrValues resolve. The resolution value of the returned promise will be an array of length $howMany containing the resolution values of the triggering items.
public static some ( Kraken\Promise\PromiseInterface[] | mixed[] $promisesOrValues, integer $howMany ) : Kraken\Promise\PromiseInterface
$promisesOrValues Kraken\Promise\PromiseInterface[] | mixed[]
$howMany integer
Результат Kraken\Promise\PromiseInterface