src/AbstractPool.php
public function wait($block = true, $sleep = 100)
    {
        do {
            foreach ($this->processes as $process) {
                if (!$process->isRunning()) {
                    continue;
                }
            }
            usleep($sleep);
        } while ($block && $this->aliveCount() > 0);
    }
public function wait($block = true, $sleep = 100)
    {
        do {
            foreach ($this->processes as $process) {
                if (!$process->isRunning()) {
                    continue;
                }
            }
            usleep($sleep);
        } while ($block && $this->aliveCount() > 0);
    }
public function wait ( $ block = true , $ sleep = 100 ) { do { foreach ( $ this -> processes as $ process ) { if ( ! $ process -> isRunning ( ) ) { continue ; } } usleep ( $ sleep ) ; } while ( $ block && $ this -> aliveCount ( ) > 0 ) ; }
waiting for the sub processes to exit

@param bool|true $block if true the parent process will be blocked until all
sub processes exit. else it will check if there are processes that had been exited once and return.
@param int $sleep when $block is true, it will check sub processes every $sleep minute
waiting for the sub processes to exit