Exemple #1
0
 public function testJobWithNamespace()
 {
     Resque::setBackend(REDIS_HOST, REDIS_DATABASE, 'php');
     $queue = 'jobs';
     $payload = ['another_value'];
     Resque::enqueue($queue, 'Test_Job_With_TearDown', $payload);
     $this->assertEquals(Resque::queues(), ['jobs']);
     $this->assertEquals(Resque::size($queue), 1);
     Resque::setBackend(REDIS_HOST, REDIS_DATABASE, REDIS_NAMESPACE);
     $this->assertEquals(Resque::size($queue), 0);
 }
Exemple #2
0
 /**
  * Return an array containing all of the queues that this worker should use
  * when searching for jobs.
  *
  * If * is found in the list of queues, every queue will be searched in
  * alphabetic order. (@see $fetch)
  *
  * @param boolean $fetch If true, and the queue is set to *, will fetch
  * all queue names from redis.
  * @return array Array of associated queues.
  */
 public function queues($fetch = true)
 {
     if (!in_array('*', $this->queues) || $fetch == false) {
         return $this->queues;
     }
     $queues = Resque::queues();
     sort($queues);
     return $queues;
 }