Python tutorials updated to pika 0.9.5
This commit is contained in:
parent
596faaf044
commit
4597ec0161
@ -5,13 +5,13 @@ tutorials](http://www.rabbitmq.com/getstarted.html).
|
||||
|
||||
## Requirements
|
||||
|
||||
To run this code you need `pika` library version 0.9.4. To install it run
|
||||
To run this code you need `pika` library version 0.9.5. To install it run
|
||||
|
||||
pip install -e git+http://github.com/pika/pika.git@v0.9.4#egg=pika-v0.9.4
|
||||
pip install -e git+http://github.com/pika/pika.git@v0.9.5#egg=pika-v0.9.5
|
||||
|
||||
or
|
||||
|
||||
easy_install pika==0.9.4
|
||||
easy_install pika==0.9.5
|
||||
|
||||
|
||||
## Code
|
||||
|
@ -32,7 +32,7 @@ def on_request(ch, method, props, body):
|
||||
body=str(response))
|
||||
ch.basic_ack(delivery_tag = method.delivery_tag)
|
||||
|
||||
channel.basic_qos(prefetch_count=1, prefetch_size=0L)
|
||||
channel.basic_qos(prefetch_count=1)
|
||||
channel.basic_consume(on_request, queue='rpc_queue')
|
||||
|
||||
print " [x] Awaiting RPC requests"
|
||||
|
@ -15,7 +15,7 @@ def callback(ch, method, properties, body):
|
||||
print " [x] Done"
|
||||
ch.basic_ack(delivery_tag = method.delivery_tag)
|
||||
|
||||
channel.basic_qos(prefetch_count=1, prefetch_size=0L)
|
||||
channel.basic_qos(prefetch_count=1)
|
||||
channel.basic_consume(callback,
|
||||
queue='task_queue')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user