Example #1
0
 /**
  * @inheritdoc
  */
 public function markAsError(JobInterface $job)
 {
     return $this->beanstalk->bury($job->getId());
 }
Example #2
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 #3
0
 /**
  * @inheritdoc
  */
 public function store(JobInterface $job)
 {
     $dbTimestampFormat = 'Y-m-d H:i:s';
     return (bool) $this->insert(['tube' => $job->getQueue(), 'data' => serialize($job->getBody()), 'scheduled_ts' => $job->getDatetimeDelay()->format($dbTimestampFormat), 'priority' => $job->getPriority(), 'ttr' => $job->getTtr(), 'create_ts' => date($dbTimestampFormat)]);
 }