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

1

26

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?

Tobey answered 23/1, 2011 at 7:36 Comment(1)
+1 @Alaa, hmm thanks never new about beanstalkd looks useful. I'll try playing around with this :)Magnifico
B
33

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.

Ballet answered 23/1, 2011 at 11:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.