src/FixedPool.php
public function wait($block = false, $interval = 100)
    {
        do {
            if ($this->isFinished()) {
                return;
            }
            parent::wait(false);
            if ($this->aliveCount() < $this->max) {
                foreach ($this->processes as $process) {
                    if ($process->isStarted()) continue;
                    $process->start();
                    if ($this->aliveCount() >= $this->max) break;
                }
            }
            $block ? usleep($interval) : null;
        } while ($block);
    }
public function wait($block = false, $interval = 100)
    {
        do {
            if ($this->isFinished()) {
                return;
            }
            parent::wait(false);
            if ($this->aliveCount() < $this->max) {
                foreach ($this->processes as $process) {
                    if ($process->isStarted()) continue;
                    $process->start();
                    if ($this->aliveCount() >= $this->max) break;
                }
            }
            $block ? usleep($interval) : null;
        } while ($block);
    }
public function wait ( $ block = false , $ interval = 100 ) { do { if ( $ this -> isFinished ( ) ) { return ; } parent :: wait ( false ) ; if ( $ this -> aliveCount ( ) < $ this -> max ) { foreach ( $ this -> processes as $ process ) { if ( $ process -> isStarted ( ) ) continue ; $ process -> start ( ) ; if ( $ this -> aliveCount ( ) >= $ this -> max ) break ; } } $ block ? usleep ( $ interval ) : null ; } while ( $ block ) ; }
wait for all process done

@param bool $block block the master process
to keep the sub process count all the time
@param int $interval check time interval
wait for all process done