(PECL pthreads >= 2.0.0)
Pool::__construct — Crée un nouveau Pool de Workers
Construit un nouveau Pool de Workers
sizeLe nombre maximal de Workers que ce Pool peut créer
classLa classe pour les nouveaux Workers
ctorUn tableau d'arguments à passer aux nouveaux Workers
Le nouveau Pool
Exemple #1 Création d'un Pool
<?php
class MyWorker extends Worker {
    
    public function __construct(Something $something) {
        $this->something = $something;
    }
    
    public function run() {
        /** ... **/
    }
}
$pool = new Pool(8, \MyWorker::class, [new Something()]);
var_dump($pool);
?>
L'exemple ci-dessus va afficher :
object(Pool)#1 (6) {
  ["size":protected]=>
  int(8)
  ["class":protected]=>
  string(8) "MyWorker"
  ["workers":protected]=>
  NULL
  ["work":protected]=>
  NULL
  ["ctor":protected]=>
  array(1) {
    [0]=>
    object(Something)#2 (0) {
    }
  }
  ["last":protected]=>
  int(0)
}