/**
* @throws Comos\Qpm\Supervision\StopSignal
*/
protected function _startOne()
{
Logger::debug(__METHOD__ . '()');
$target = null;
try {
$target = \call_user_func($this->_config->getFactoryMethod());
} catch (StopSignal $ex) {
Logger::debug('received stop signal');
throw $ex;
} catch (\Exception $ex) {
Logger::err($ex);
\usleep(self::SLEEP_TIME_AFTER_ERROR);
}
if (!$target) {
Logger::debug('fetched target is null. skipped');
return;
}
try {
$process = Process::fork($target);
$this->_children[$process->getPid()] = new ProcessStub($process, $this->_config);
} catch (\Exception $ex) {
Logger::err('exception', array('exception' => $ex));
\usleep(self::SLEEP_TIME_AFTER_ERROR);
}
}