PHP Class Jenner\SimpleFork\ParallelPool

Inheritance: extends AbstractPool
Afficher le fichier Open project: huyanping/simple-fork-php Class Usage Examples

Protected Properties

Свойство Type Description
$max max process count
$runnable sub process callback

Méthodes publiques

Méthode Description
__construct ( callable | Jenner\SimpleFork\Runnable $callback, integer $max = 4 )
count ( ) : integer return process count
getProcesses ( ) : Process[] get all processes
keep ( boolean $block = false, integer $interval = 100 ) keep sub process count
reload ( boolean $block = true ) start the same number processes and kill the old sub process just like nginx -s reload this method will block until all the old process exit;
start ( ) start the pool

Method Details

__construct() public méthode

public __construct ( callable | Jenner\SimpleFork\Runnable $callback, integer $max = 4 )
$callback callable | Jenner\SimpleFork\Runnable
$max integer

count() public méthode

return process count
public count ( ) : integer
Résultat integer

getProcesses() public méthode

get all processes
public getProcesses ( ) : Process[]
Résultat Process[]

keep() public méthode

keep sub process count
public keep ( boolean $block = false, integer $interval = 100 )
$block boolean block the master process to keep the sub process count all the time
$interval integer check time interval

reload() public méthode

start the same number processes and kill the old sub process just like nginx -s reload this method will block until all the old process exit;
public reload ( boolean $block = true )
$block boolean

start() public méthode

start the pool
public start ( )

Property Details

$max protected_oe property

max process count
protected $max

$runnable protected_oe property

sub process callback
protected $runnable