Exemple #1
0
 /**
  * @param $debug
  *
  * @return ParaunitProcessInterface | null
  */
 protected function runProcess($debug)
 {
     if ($this->maxProcessNumber > count($this->processRunning) && count($this->processStack) > 0) {
         /** @var ParaunitProcessInterface $process */
         $process = array_pop($this->processStack);
         $process->start();
         $this->processRunning[$process->getUniqueId()] = $process;
         if ($debug) {
             DebugPrinter::printDebugOutput($process, $this->processRunning);
         }
         return $process;
     }
     return null;
 }
Exemple #2
0
 /**
  * @return ParaunitProcessAbstract
  */
 protected function runProcess()
 {
     if ($this->maxProcessNumber > count($this->processRunning) && !empty($this->processStack)) {
         /** @var ParaunitProcessInterface $process */
         $process = array_pop($this->processStack);
         $process->start();
         $this->processRunning[md5($process->getCommandLine())] = $process;
         if ($this->debugMode) {
             DebugPrinter::printDebugOutput($process, $this->processRunning);
         }
         return $process;
     }
 }