コード例 #1
0
 /**
  * Establish a queue connection.
  *
  * @param  array $config
  *
  * @return \StudioBonito\SilverStripe\Queue\QueueInterface
  */
 public function connect(array $config)
 {
     $queue = isset($config['queue']) ? $config['queue'] : 'default';
     return DbQueue::create($queue);
 }
コード例 #2
0
 /**
  * Release the job back into the queue.
  *
  * @param  int $delay
  *
  * @return void
  */
 public function release($delay = 0)
 {
     $this->delete();
     $this->db->release($this->queue, $this->getRawPayload(), $delay, $this->attempts() + 1);
 }