| 1 | <?php |
||
| 17 | class FixedPool extends AbstractPool |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var int max process count |
||
| 21 | */ |
||
| 22 | protected $max; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param int $max |
||
| 26 | */ |
||
| 27 | 3 | public function __construct($max = 4) |
|
| 31 | |||
| 32 | 3 | public function execute(Process $process) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * wait for all process done |
||
| 44 | * |
||
| 45 | * @param bool $block block the master process |
||
| 46 | * to keep the sub process count all the time |
||
| 47 | * @param int $interval check time interval |
||
| 48 | */ |
||
| 49 | 3 | public function wait($block = false, $interval = 100) |
|
| 66 | |||
| 67 | } |