0

I am working on a feature where I need to check the job status in beanstalkd queues. I have tried a few things but I am not getting the jobs that are reserved for queues other than the default queue

$pheanstalk = \Illuminate\Support\Facades\Queue::getPheanstalk();
$pheanstalk->useTube('import-live');
$pheanstalk->watch('import-live');
while ($job = $pheanstalk->reserve(0)) {
    var_dump(json_decode($job->getData(), true));
}

This is what I have tried. But I still get the data for the default queue. Anyone has any idea on how to get the data for the import-live queue as well? Or any other queues I have running in my system. Basically I want to get the data on all the queues in the system.

Rohan
  • 13,308
  • 21
  • 81
  • 154

1 Answers1

0

First of all - make sure that there are jobs in the other queues.

Then, if you don't want to get jobs from the 'default' queue for a particular run, you can ignore a it.

$job = $pheanstalk
    ->watch('import-live')
    ->watch('import-other')
    ->ignore('default')
    ->reserve();

->useTube('..') is only used when put()-ing messages into a queue.

Alister Bulman
  • 34,482
  • 9
  • 71
  • 110