[rabbitmq-discuss] Blocking queue.get() in python?

yoav glazner yoavglazner at gmail.com
Mon Jan 31 19:59:35 GMT 2011


I'm trying to implement a priority queue over Rabbit with python, and this
is my idea
each batch of tasks has its own queue, each worker knows about all the
batches and their priorities.
now the part where I don't understand:
  how does a worker tries a take a task from a batch(queue)  but if its
empty it passes to the next batch?

I need somthing like:

for q in queuesSortedByPriority:
  t = q.get()
  if t: break
else: raise NoTaskFound()

Many thanks,

Yoav Glazner.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110131/435ab182/attachment.htm>

More information about the rabbitmq-discuss mailing list