/** * @param Job $job * @return bool */ public function startJob(Job $job) { $this->pool->add($job); try { $runtime = new Runtime(); $job->start($runtime->getBinary()); } catch (ForkException $e) { $this->pool->remove($job); $job->startTest(); $job->addError($e); $job->endTest(); return false; } $job->startTest(); return true; }
/** * @param Job $job * @return $this */ public function addJob(Job $job) { if (!$this->jobs->contains($job)) { $this->jobs->add($job); } return $this; }