[rabbitmq-discuss] Blocking queue.get() in python?
Gavin M. Roy
gmr at myyearbook.com
Tue Feb 1 19:03:54 GMT 2011
It's the Basic.Get AMQP command. Pika and other clients implement this.
In pika it's channel.basic_get()
For the blocking behavior, you'll want to use the blocking adapter.
On Tue, Feb 1, 2011 at 1:43 PM, yoav glazner <yoavglazner at gmail.com> wrote:
> 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?
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
More information about the rabbitmq-discuss
mailing list