hasAlive() public méthode

Return TRUE is manager has alive children processes.
public hasAlive ( ) : boolean
Résultat boolean
 public function testHasNoAliveAfterWait()
 {
     $this->manager->fork(function () {
         usleep(5000);
     });
     $this->manager->wait();
     $this->assertFalse($this->manager->hasAlive());
 }
Exemple #2
0
 public function testProcessCanTerminateOnSigTerm()
 {
     $m = new ProcessManager();
     $process = $m->fork(function (Process &$p) {
         while (!$p->isShouldShutdown()) {
             $p->dispatch();
             usleep(100);
         }
     });
     $process->kill();
     $process->wait();
     $this->assertFalse($m->hasAlive());
 }