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

yoav glazner yoavglazner at gmail.com
Tue Feb 1 18:43:59 GMT 2011


On Mon, Jan 31, 2011 at 9:59 PM, yoav glazner <yoavglazner at gmail.com> wrote:

> Hi,
>
> 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()
>

I saw in the java example-
http://www.rabbitmq.com/tutorial-one-java.html
the following line:
QueueingConsumer.nextDelivery() blocks until another message has been
delivered from the server.
I haven't seen anything like this for python. is there anything similar?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110201/4eb755fc/attachment.htm>


More information about the rabbitmq-discuss mailing list