PHP Интерфейс Kraken\Runtime\RuntimeModelInterface

Наследование: extends Kraken\Runtime\RuntimeContextInterface, extends Kraken\Runtime\RuntimeManagerAwareInterface, extends Kraken\Supervision\SupervisorAwareInterface, extends Kraken\Core\CoreAwareInterface, extends Kraken\Event\EventEmitterAwareInterface, extends Kraken\Loop\LoopExtendedAwareInterface
Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
create ( ) : Kraken\Promise\PromiseInterface Create model.
destroy ( ) : Kraken\Promise\PromiseInterface Destroy model.
fail ( Erro\Error | Exceptio\Exception $ex, mixed[] $params = [] ) Temporarily switch model to failed workflow and allow supervisor to take control.
getHash ( ) : string | null Return failure hash if the container is in the failed state or null if it is not.
getState ( ) : integer Return state of model.
isCreated ( ) : boolean Checks if model is in created state.
isDestroyed ( ) : boolean Checks if model is in destroyed state.
isFailed ( ) : boolean Checks if model is in stopped state.
isStarted ( ) : boolean Checks if model is in started state.
isState ( integer $state ) : boolean Checks if model is in specified state.
isStopped ( ) : boolean Checks if model is in stopped state.
setState ( integer $state ) Set state of model.
start ( ) : Kraken\Promise\PromiseInterface Start model.
state ( ) : integer
stop ( ) : Kraken\Promise\PromiseInterface Stop model.
succeed ( ) Switch back from failed to normal workflow.

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

create() публичный Метод

Create model.
public create ( ) : Kraken\Promise\PromiseInterface
Результат Kraken\Promise\PromiseInterface

destroy() публичный Метод

Destroy model.
public destroy ( ) : Kraken\Promise\PromiseInterface
Результат Kraken\Promise\PromiseInterface

fail() публичный Метод

Temporarily switch model to failed workflow and allow supervisor to take control.
public fail ( Erro\Error | Exceptio\Exception $ex, mixed[] $params = [] )
$ex Erro\Error | Exceptio\Exception
$params mixed[]

getHash() публичный Метод

Return failure hash if the container is in the failed state or null if it is not.
public getHash ( ) : string | null
Результат string | null

getState() публичный Метод

Returned value might be one of: Runtime::STATE_CREATED Runtime::STATE_STARTED Runtime::STATE_STOPPED Runtime::STATE_DESTROYED
public getState ( ) : integer
Результат integer

isCreated() публичный Метод

Checks if model is in created state.
public isCreated ( ) : boolean
Результат boolean

isDestroyed() публичный Метод

Checks if model is in destroyed state.
public isDestroyed ( ) : boolean
Результат boolean

isFailed() публичный Метод

Checks if model is in stopped state.
public isFailed ( ) : boolean
Результат boolean

isStarted() публичный Метод

Checks if model is in started state.
public isStarted ( ) : boolean
Результат boolean

isState() публичный Метод

State might be one of: Runtime::STATE_CREATED Runtime::STATE_STARTED Runtime::STATE_STOPPED Runtime::STATE_DESTROYED Runtime::STATE_FAILED
public isState ( integer $state ) : boolean
$state integer
Результат boolean

isStopped() публичный Метод

Checks if model is in stopped state.
public isStopped ( ) : boolean
Результат boolean

setState() публичный Метод

The state might be one of: Runtime::STATE_CREATED Runtime::STATE_STARTED Runtime::STATE_STOPPED Runtime::STATE_DESTROYED
public setState ( integer $state )
$state integer

start() публичный Метод

Start model.
public start ( ) : Kraken\Promise\PromiseInterface
Результат Kraken\Promise\PromiseInterface

state() публичный Метод

public state ( ) : integer
Результат integer

stop() публичный Метод

Stop model.
public stop ( ) : Kraken\Promise\PromiseInterface
Результат Kraken\Promise\PromiseInterface

succeed() публичный Метод

Switch back from failed to normal workflow.
public succeed ( )