PHP Class Kraken\Runtime\Container\Manager\ThreadManagerBase

Inheritance: implements Kraken\Runtime\Container\ThreadManagerInterface
Show file Open project: kraken-php/framework

Protected Properties

Property Type Description
$channel Kraken\Channel\ChannelInterface
$context string[]
$runtime Kraken\Runtime\RuntimeContainerInterface
$threads Kraken\Runtime\Container\Thread\ThreadWrapper[]

Public Methods

Method Description
__construct ( Kraken\Runtime\RuntimeContainerInterface $runtime, Kraken\Channel\ChannelInterface $channel, string[] $context )
__destruct ( )
allocateThread ( string $alias, mixed $object ) : boolean Allocate thread data.
createThread ( $alias, $name, $flags = Runtime::CREATE_DEFAULT, $params = [] )
createThreads ( $definitions, $flags = Runtime::CREATE_DEFAULT, $params = [] )
destroyThread ( $alias, $flags = Runtime::DESTROY_FORCE_SOFT, $params = [] )
destroyThreads ( $aliases, $flags = Runtime::DESTROY_FORCE_SOFT, $params = [] )
existsThread ( $alias )
flushThreads ( $flags = Runtime::DESTROY_KEEP )
freeThread ( string $alias ) : boolean Free thread data.
getThreads ( )
sendCommand ( $alias, $command, $params = [] )
sendMessage ( $alias, $message, $flags = Channel::MODE_DEFAULT )
sendRequest ( $alias, $message, $params = [] )
startThread ( $alias, $params = [] )
startThreads ( $aliases, $params = [] )
stopThread ( $alias, $params = [] )
stopThreads ( $aliases, $params = [] )

Protected Methods

Method Description
createRequest ( Kraken\Channel\ChannelInterface $channel, string $receiver, string $command ) : Request Create Request.

Method Details

__construct() public method

public __construct ( Kraken\Runtime\RuntimeContainerInterface $runtime, Kraken\Channel\ChannelInterface $channel, string[] $context )
$runtime Kraken\Runtime\RuntimeContainerInterface
$channel Kraken\Channel\ChannelInterface
$context string[]

__destruct() public method

public __destruct ( )

allocateThread() public method

Allocate thread data.
public allocateThread ( string $alias, mixed $object ) : boolean
$alias string
$object mixed
return boolean

createRequest() protected method

Create Request.
protected createRequest ( Kraken\Channel\ChannelInterface $channel, string $receiver, string $command ) : Request
$channel Kraken\Channel\ChannelInterface
$receiver string
$command string
return Kraken\Channel\Extra\Request

createThread() public method

public createThread ( $alias, $name, $flags = Runtime::CREATE_DEFAULT, $params = [] )

createThreads() public method

public createThreads ( $definitions, $flags = Runtime::CREATE_DEFAULT, $params = [] )

destroyThread() public method

public destroyThread ( $alias, $flags = Runtime::DESTROY_FORCE_SOFT, $params = [] )

destroyThreads() public method

public destroyThreads ( $aliases, $flags = Runtime::DESTROY_FORCE_SOFT, $params = [] )

existsThread() public method

public existsThread ( $alias )

flushThreads() public method

public flushThreads ( $flags = Runtime::DESTROY_KEEP )

freeThread() public method

Free thread data.
public freeThread ( string $alias ) : boolean
$alias string
return boolean

getThreads() public method

public getThreads ( )

sendCommand() public method

public sendCommand ( $alias, $command, $params = [] )

sendMessage() public method

public sendMessage ( $alias, $message, $flags = Channel::MODE_DEFAULT )

sendRequest() public method

public sendRequest ( $alias, $message, $params = [] )

startThread() public method

public startThread ( $alias, $params = [] )

startThreads() public method

public startThreads ( $aliases, $params = [] )

stopThread() public method

public stopThread ( $alias, $params = [] )

stopThreads() public method

public stopThreads ( $aliases, $params = [] )

Property Details

$channel protected property

protected ChannelInterface,Kraken\Channel $channel
return Kraken\Channel\ChannelInterface

$context protected property

protected string[] $context
return string[]

$runtime protected property

protected RuntimeContainerInterface,Kraken\Runtime $runtime
return Kraken\Runtime\RuntimeContainerInterface

$threads protected property

protected ThreadWrapper[],Kraken\Runtime\Container\Thread $threads
return Kraken\Runtime\Container\Thread\ThreadWrapper[]