PHP Interface Kraken\Runtime\Container\ProcessManagerInterface

Inheritance: extends Kraken\Runtime\Container\AbstractManagerInterface
显示文件 Open project: kraken-php/framework Interface Usage Examples

Public Methods

Method Description
createProcess ( string $alias, string $name, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Create a new process container.
createProcesses ( string[][] $definitions, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Create multiple process containers at once.
destroyProcess ( string $alias, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Destroy existing container.
destroyProcesses ( string[] $aliases, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Destroy multiple process containers at once.
existsProcess ( string $alias ) : boolean Check if process container exists.
flushProcesses ( integer $flags = Runtime::DESTROY_KEEP ) : Kraken\Promise\PromiseInterface Flush processes without destroying them.
getProcesses ( ) : Kraken\Promise\PromiseInterface Get list of existing process containers.
startProcess ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Start existing process container.
startProcesses ( $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Start multiple process containers at once.
stopProcess ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Stop existing process container.
stopProcesses ( $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Stop multiple process containers at once.

Method Details

createProcess() public method

Flags might be one of: Runtime::CREATE_DEFAULT - creates a new process only if it does not already exist Runtime::CREATE_FORCE_SOFT - does the same as CREATE_DEFAULT, but in case of existing process tries to replace it. Replacement is done by destroying existing process by sending shutdown message. Runtime::CREATE_FORCE_HARD - does the same as CREATE_DEFAULT, but in case of existing process tries to replace it. Replacement is done by forcefully destroying existing process. Runtime::CREATE_FORCE - creates a new process if it does not exist or tries to replace existing firstly trying to destroy it gracefully, but it fails doing it forcefully.
public createProcess ( string $alias, string $name, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$name string
$flags integer
$params mixed[]
return Kraken\Promise\PromiseInterface

createProcesses() public method

Create multiple process containers at once.
See also: ProcessManagerInterface::createProcesses
public createProcesses ( string[][] $definitions, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$definitions string[][]
$flags integer
$params mixed[]
return Kraken\Promise\PromiseInterface

destroyProcess() public method

Flags might be one of: Runtime::DESTROY_KEEP - sets manager to not destroy runtime Runtime::DESTROY_FORCE_SOFT - destroys runtime by sending message to shutdown Runtime::DESTROY_FORCE_HARD - destroys runtime forcefully and immediately Runtime::DESTROY_FORCE - first, tries to gracefully destroy runtime by sending message to shutdown, if it does not receive answer, then closes it forcefully.
public destroyProcess ( string $alias, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$flags integer
$params mixed[]
return Kraken\Promise\PromiseInterface

destroyProcesses() public method

Destroy multiple process containers at once.
See also: ProcessManagerInterface::destroyProcesses
public destroyProcesses ( string[] $aliases, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$aliases string[]
$flags integer
$params mixed[]
return Kraken\Promise\PromiseInterface

existsProcess() public method

Check if process container exists.
public existsProcess ( string $alias ) : boolean
$alias string
return boolean

flushProcesses() public method

Flush processes without destroying them.
public flushProcesses ( integer $flags = Runtime::DESTROY_KEEP ) : Kraken\Promise\PromiseInterface
$flags integer
return Kraken\Promise\PromiseInterface

getProcesses() public method

Get list of existing process containers.
public getProcesses ( ) : Kraken\Promise\PromiseInterface
return Kraken\Promise\PromiseInterface

startProcess() public method

Start existing process container.
public startProcess ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$params mixed[]
return Kraken\Promise\PromiseInterface

startProcesses() public method

Start multiple process containers at once.
public startProcesses ( $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$aliases
$params mixed[]
return Kraken\Promise\PromiseInterface

stopProcess() public method

Stop existing process container.
public stopProcess ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$params mixed[]
return Kraken\Promise\PromiseInterface

stopProcesses() public method

Stop multiple process containers at once.
public stopProcesses ( $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$aliases
$params mixed[]
return Kraken\Promise\PromiseInterface