Example #1
0
 /**
  * @param JobInterface $job
  * @return string
  */
 public static function serializeBody(JobInterface $job)
 {
     return serialize(['queue' => $job->getQueue(), 'body' => $job->getBody(), 'delay' => $job->getDelay(), 'priority' => $job->getPriority(), 'ttr' => $job->getTtr()]);
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function markAsIncomplete(JobInterface $job)
 {
     if ($this->scheduler->shouldBeScheduled($job->getDelay())) {
         if ($job->getId() !== null) {
             $this->beanstalk->delete($job->getId());
         }
         return $this->scheduler->store($job);
     } else {
         return $this->beanstalk->useTube($job->getQueue())->release($job->getId(), $job->getPriority(), $job->getDelay());
     }
 }