Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * @param Job $job
  * @return $this
  */
 public function addJob(Job $job)
 {
     if (!$this->jobs->contains($job)) {
         $this->jobs->add($job);
     }
     return $this;
 }