| 1 | <?php |
||
| 12 | class PoolFactory |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * create a pool instance |
||
| 16 | * |
||
| 17 | * @return Pool |
||
| 18 | */ |
||
| 19 | public static function newPool() |
||
| 23 | |||
| 24 | /** |
||
| 25 | * create a fixed pool instance |
||
| 26 | * |
||
| 27 | * @param int $max |
||
| 28 | * @return FixedPool |
||
| 29 | */ |
||
| 30 | 3 | public static function newFixedPool($max = 4) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * create a parallel pool instance |
||
| 37 | * |
||
| 38 | * @param $callback |
||
| 39 | * @param int $max |
||
| 40 | * @return ParallelPool |
||
| 41 | */ |
||
| 42 | public static function newParallelPool($callback, $max = 4) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * create a single pool |
||
| 49 | * |
||
| 50 | * @return SinglePool |
||
| 51 | */ |
||
| 52 | public static function newSinglePool() |
||
| 56 | } |