function it_deletes_workers_from_redis(RedisClientInterface $redis, WorkerInterface $worker)
 {
     $worker->getId()->shouldBeCalled()->willReturn('local:789');
     $redis->srem('workers', 'local:789')->shouldBeCalled()->willReturn(1);
     $redis->del('worker:local:789')->shouldBeCalled()->willReturn(1);
     $redis->del('worker:local:789:started')->shouldBeCalled()->willReturn(1);
     $this->delete($worker)->shouldReturn($this);
 }
 /**
  * {@inheritDoc}
  */
 public function delete(QueueInterface $queue)
 {
     $this->redis->multi();
     $this->redis->llen($this->getRedisKey($queue));
     $this->redis->del($this->getRedisKey($queue));
     $this->redis->srem('queues', $queue->getName());
     $responses = $this->redis->exec();
     if (isset($responses[0])) {
         return $responses[0];
     }
     return 0;
 }
 function it_deletes_queue_from_redis(QueueInterface $queue, RedisClientInterface $redis)
 {
     $queue->getName()->shouldBeCalled()->willReturn('high');
     $redis->multi()->shouldBeCalled();
     $redis->llen('queue:high')->shouldBeCalled();
     $redis->del('queue:high')->shouldBeCalled();
     $redis->srem('queues', 'high')->shouldBeCalled();
     $redis->exec()->shouldBeCalled()->willReturn(array(5));
     $this->delete($queue)->shouldReturn(5);
 }
 function it_stops_tracking_of_a_job(RedisClientInterface $redis, JobInterface $job)
 {
     $job->getId()->willReturn('123');
     $redis->del('job:123:status')->shouldBeCalled();
     $this->stop($job);
 }
Beispiel #5
0
 /**
  * {@inheritDoc}
  */
 public function stop(JobInterface $job)
 {
     $this->redis->del($this->getRedisKey($job));
 }
Beispiel #6
0
 function it_clears_list_failed_jobs(RedisClientInterface $redis)
 {
     $redis->del('failed')->shouldBeCalled();
     $this->clear();
 }
 function it_can_clear_stat(RedisClientInterface $redis)
 {
     $redis->del('stat:test')->shouldBeCalled()->willReturn(true);
     $this->clear('test', 11)->shouldReturn(true);
 }