private verifyRunning ( boolean $stop = false ) : integer | ||
$stop | boolean | stops execution of running units, probably to stop execution |
return | integer | number of running units |
private function verifyRunning($stop = false)
{
$count = 0;
foreach ($this->runningUnits as $i => $units) {
foreach ($units as $j => $unit) {
if ($stop) {
$unit->reset();
} elseif (!$unit->isProcessFinished()) {
$count++;
continue;
}
$this->output('finished unit#' . $unit->getId());
$this->runStorage->saveRunUnit($unit);
unset($this->runningUnits[$i][$j]);
}
}
return $count;
}