Exemplo n.º 1
0
 public function testDelete()
 {
     $job = new RedisQueueIntegrationTestJob(30);
     $this->queue->push($job);
     /** @var RedisJob $redisJob */
     $redisJob = $this->queue->pop();
     $redisJob->delete();
     $this->assertEquals(0, $this->redis->connection()->zcard('queues:default:delayed'));
     $this->assertEquals(0, $this->redis->connection()->zcard('queues:default:reserved'));
     $this->assertEquals(0, $this->redis->connection()->llen('queues:default'));
     $this->assertNull($this->queue->pop());
 }
Exemplo n.º 2
0
 /**
  * Release the job back into the queue.
  *
  * @param  int   $delay
  * @return void
  */
 public function release($delay = 0)
 {
     parent::release($delay);
     $this->redis->deleteAndRelease($this->queue, $this->reserved, $delay);
 }
Exemplo n.º 3
0
 /**
  * Establish a queue connection.
  *
  * @param  array  $config
  * @return \Illuminate\Contracts\Queue\Queue
  */
 public function connect(array $config)
 {
     $queue = new RedisQueue($this->redis, $config['queue'], Arr::get($config, 'connection', $this->connection));
     $queue->setExpire(Arr::get($config, 'expire', 60));
     return $queue;
 }