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

Наследование: extends Kraken\Runtime\Container\AbstractManagerInterface
Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
createThread ( string $alias, string $name, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Create a new thread container.
createThreads ( string[][] $definitions, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Create multiple thread containers at once.
destroyThread ( string $alias, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Destroy existing container.
destroyThreads ( string[] $aliases, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Destroy multiple thread containers at once.
existsThread ( string $alias ) : boolean Check if thread container exists.
flushThreads ( integer $flags = Runtime::DESTROY_KEEP ) : Kraken\Promise\PromiseInterface Flush threads without destroying them.
getThreads ( ) : Kraken\Promise\PromiseInterface Get list of existing thread containers.
startThread ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Start existing thread container.
startThreads ( string[] $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Start multiple thread container at once.
stopThread ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Stop existing thread container.
stopThreads ( string[] $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface Stop multiple thread container at once.

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

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

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

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

Create multiple thread containers at once.
См. также: RuntimeManagerInterface::createThreads
public createThreads ( string[][] $definitions, integer $flags = Runtime::CREATE_DEFAULT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$definitions string[][]
$flags integer
$params mixed[]
Результат Kraken\Promise\PromiseInterface

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

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 destroyThread ( string $alias, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$flags integer
$params mixed[]
Результат Kraken\Promise\PromiseInterface

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

Destroy multiple thread containers at once.
См. также: ThreadManagerInterface::destroyThreads
public destroyThreads ( string[] $aliases, integer $flags = Runtime::DESTROY_FORCE_SOFT, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$aliases string[]
$flags integer
$params mixed[]
Результат Kraken\Promise\PromiseInterface

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

Check if thread container exists.
public existsThread ( string $alias ) : boolean
$alias string
Результат boolean

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

Flush threads without destroying them.
public flushThreads ( integer $flags = Runtime::DESTROY_KEEP ) : Kraken\Promise\PromiseInterface
$flags integer
Результат Kraken\Promise\PromiseInterface

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

Get list of existing thread containers.
public getThreads ( ) : Kraken\Promise\PromiseInterface
Результат Kraken\Promise\PromiseInterface

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

Start existing thread container.
public startThread ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$params mixed[]
Результат Kraken\Promise\PromiseInterface

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

Start multiple thread container at once.
public startThreads ( string[] $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$aliases string[]
$params mixed[]
Результат Kraken\Promise\PromiseInterface

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

Stop existing thread container.
public stopThread ( string $alias, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$alias string
$params mixed[]
Результат Kraken\Promise\PromiseInterface

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

Stop multiple thread container at once.
public stopThreads ( string[] $aliases, mixed[] $params = [] ) : Kraken\Promise\PromiseInterface
$aliases string[]
$params mixed[]
Результат Kraken\Promise\PromiseInterface