PHP 클래스 Kraken\Promise\Promise

상속: implements Kraken\Promise\PromiseInterface, use trait Kraken\Promise\Partial\PromiseTrait
파일 보기 프로젝트 열기: kraken-php/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$canceller callable
$currentCancellations integer
$handlers callable[]
$requiredCancellations integer
$result Kraken\Promise\PromiseInterface | null

공개 메소드들

메소드 설명
__construct ( callable $resolver = null, callable $canceller = null )
__destruct ( )
abort ( callable $onCancel )
always ( callable $onFulfilledOrRejected )
cancel ( $reason = null )
done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
failure ( callable $onFailure )
getPromise ( )
isCancelled ( )
isFulfilled ( )
isPending ( )
isRejected ( )
reject ( $reason = null )
resolve ( $value = null )
spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
success ( callable $onSuccess )
then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )

보호된 메소드들

메소드 설명
getReason ( ) : Erro\Error | Exceptio\Exception | string | null Return rejection or cancellation reason for Promise.
getResult ( ) : Kraken\Promise\PromiseInterface | null Get Promise result. Returns fulfilled, rejected or cancelled Promise for settled Promises or null for pending.
getValue ( ) : mixed | null Return primitive value associated with Promise.
mutate ( callable $resolver = null ) Mutate resolver.
settle ( Kraken\Promise\PromiseInterface $promise ) : Kraken\Promise\PromiseInterface Settle Promise with another Promise.

메소드 상세

__construct() 공개 메소드

public __construct ( callable $resolver = null, callable $canceller = null )
$resolver callable
$canceller callable

__destruct() 공개 메소드

public __destruct ( )

abort() 공개 메소드

public abort ( callable $onCancel )
$onCancel callable

always() 공개 메소드

public always ( callable $onFulfilledOrRejected )
$onFulfilledOrRejected callable

cancel() 공개 메소드

public cancel ( $reason = null )

done() 공개 메소드

public done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable

failure() 공개 메소드

public failure ( callable $onFailure )
$onFailure callable

getPromise() 공개 메소드

public getPromise ( )

getReason() 보호된 메소드

Return rejection or cancellation reason for Promise.
protected getReason ( ) : Erro\Error | Exceptio\Exception | string | null
리턴 Erro\Error | Exceptio\Exception | string | null

getResult() 보호된 메소드

Get Promise result. Returns fulfilled, rejected or cancelled Promise for settled Promises or null for pending.
protected getResult ( ) : Kraken\Promise\PromiseInterface | null
리턴 Kraken\Promise\PromiseInterface | null

getValue() 보호된 메소드

Return primitive value associated with Promise.
protected getValue ( ) : mixed | null
리턴 mixed | null

isCancelled() 공개 메소드

public isCancelled ( )

isFulfilled() 공개 메소드

public isFulfilled ( )

isPending() 공개 메소드

public isPending ( )

isRejected() 공개 메소드

public isRejected ( )

mutate() 보호된 메소드

Mutate resolver.
protected mutate ( callable $resolver = null )
$resolver callable

reject() 공개 메소드

public reject ( $reason = null )

resolve() 공개 메소드

public resolve ( $value = null )

settle() 보호된 메소드

Settle Promise with another Promise.
또한 보기: PromiseInterface::resolve
또한 보기: PromiseInterface::reject
또한 보기: PromiseInterface::cancel
protected settle ( Kraken\Promise\PromiseInterface $promise ) : Kraken\Promise\PromiseInterface
$promise Kraken\Promise\PromiseInterface
리턴 Kraken\Promise\PromiseInterface

spread() 공개 메소드

public spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable

success() 공개 메소드

public success ( callable $onSuccess )
$onSuccess callable

then() 공개 메소드

public then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable

프로퍼티 상세

$canceller 보호되어 있는 프로퍼티

protected callable $canceller
리턴 callable

$currentCancellations 보호되어 있는 프로퍼티

protected int $currentCancellations
리턴 integer

$handlers 보호되어 있는 프로퍼티

protected callable[] $handlers
리턴 callable[]

$requiredCancellations 보호되어 있는 프로퍼티

protected int $requiredCancellations
리턴 integer

$result 보호되어 있는 프로퍼티

protected PromiseInterface,Kraken\Promise|null $result
리턴 Kraken\Promise\PromiseInterface | null