Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a list of all jobs in a beanstalk tube?

Tags:

beanstalkd

I have beanstalk installed on my server, and run the following:

$ telnet localhost 11300 use my_tube USING my_tube peek-ready FOUND 11065 41 {"ts":1295537419,"data":{"nid":"212156"}} 

Now my question is: how can I get a list of all jobs in the queue; something like peek-all?

like image 541
Alaa Avatar asked Jan 23 '11 07:01

Alaa


1 Answers

There are some forks of the main code that provide this sort of information (retrieving ready, reserved, and buried jobs in a tube), but its not in the main trunk version. This is because of the problems that it can bring - such as on a huge implementation it would have to return a potentially vast amount of data and block the server from doing any other work in the meantime.

Ultimately, BeanstalkD is a queue - not an array, and not designed to allow access to every item within it - it returns the next item to work on.

Thinking of the problem from another direction may be useful - such as asking why you need the information about the contents of the queue, and possibly assembling the data you would need as items are being added, by your own code.

like image 106
Alister Bulman Avatar answered Sep 22 '22 09:09

Alister Bulman