2

I've using rq and RedisToGo. How do I get the number of jobs in the queue? I can't find it in the documentation? (In Python)

When I try:

print "Before: ", len(q.jobs)
result = q.enqueue(worker.A)
result = q.enqueue(worker.B)
print "After: ", len(q.jobs)

It just gives 0 both times.

nickponline
  • 25,354
  • 32
  • 99
  • 167

1 Answers1

3

For RQ, you should be able to just get the len of the jobs in a queue:

from rq import Queue

queue = Queue()
len(queue)
Austin Richardson
  • 8,078
  • 13
  • 43
  • 49
Byron Ruth
  • 927
  • 6
  • 15