Skip to content

ssigwart/process-pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Process Pool Package

Creating a Pool

$minPoolSize = 1;
$maxPoolSize = 10;
poolProcessCmd = 'php process.php';
$cwd = '/path/to/pool/process';
$pool = new ProcessPool($minPoolSize, $maxPoolSize, $poolProcessCmd, $cwd);
$pool->setMaxNumSpareProcesses(3);

Implementing a Pool Process

The pool process should implement ssigwart\ProcessPool\ProcessPoolProcessMessageHandlerInterface. The handleRequest function should handle incoming requests. It can output to stdout and stderr, which can be read with getStdoutResponse and getStderrResponse.