Property | Type | Description | |
---|---|---|---|
$class | string | The name of the Worker class for this Pool | |
$ctor | array | The constructor arguments to be passed by this Pool to new Workers upon construction | |
$last | integer | The numeric identifier for the last Worker used by this Pool | |
$size | integer | The maximum number of Worker threads allowed in this Pool | |
$workers | array | Worker[] | The array of Worker threads for this Pool |
Method | Description | |
---|---|---|
__construct ( integer $size, string | null $class, array | null $ctor = [] ) | Construct a new Pool of Workers | |
collect ( callable $collector ) | Collect references to completed tasks | |
resize ( integer $size ) | Resize the Pool | |
shutdown ( ) | Shutdown all Workers in this Pool | |
submit ( Threaded $task ) : integer | Submit the task to the next Worker in the Pool | |
submitTo ( integer $worker, Threaded $task ) : integer | Submit the task to the specific Worker in the Pool |
protected string $class | ||
return | string |
protected array $ctor | ||
return | array |
protected int $last | ||
return | integer |
protected int $size | ||
return | integer |
protected array|Worker[] $workers | ||
return | array | Worker[] |