PHP Interface Kraken\Promise\DeferredInterface

显示文件 Open project: kraken-php/framework

Public Methods

Method Description
cancel ( Erro\Error | Exceptio\Exception | string | null $reason = null ) : Kraken\Promise\PromiseInterface Cancel promise with specified reason.
getPromise ( ) : Kraken\Promise\PromiseInterface Return promise representing return value of deferred operation.
reject ( Erro\Error | Exceptio\Exception | string | null $reason = null ) : Kraken\Promise\PromiseInterface Reject promise with specified reason.
resolve ( mixed | null $value = null ) : Kraken\Promise\PromiseInterface Resolve promise with specified value.

Method Details

cancel() public method

Cancel promise with specified reason.
public cancel ( Erro\Error | Exceptio\Exception | string | null $reason = null ) : Kraken\Promise\PromiseInterface
$reason Erro\Error | Exceptio\Exception | string | null
return Kraken\Promise\PromiseInterface

getPromise() public method

Return promise representing return value of deferred operation.
public getPromise ( ) : Kraken\Promise\PromiseInterface
return Kraken\Promise\PromiseInterface

reject() public method

Reject promise with specified reason.
public reject ( Erro\Error | Exceptio\Exception | string | null $reason = null ) : Kraken\Promise\PromiseInterface
$reason Erro\Error | Exceptio\Exception | string | null
return Kraken\Promise\PromiseInterface

resolve() public method

Resolve promise with specified value.
public resolve ( mixed | null $value = null ) : Kraken\Promise\PromiseInterface
$value mixed | null
return Kraken\Promise\PromiseInterface