Improve example in consumer user guide. Closes #298

This commit is contained in:
Ask Solem 2014-01-13 15:15:20 +00:00
parent ed6788c5ad
commit f612a949f9
1 changed files with 2 additions and 3 deletions

View File

@ -38,9 +38,8 @@ Draining events from several consumers:
from kombu.utils import nested
with connection.channel(), connection.channel() as (channel1, channel2):
consumers = [Consumer(channel1, queues1, accept=['json']),
Consumer(channel2, queues2, accept=['json'])]
with nested(\*consumers):
with nested(Consumer(channel1, queues1, accept=['json']),
Consumer(channel2, queues2, accept=['json'])):
connection.drain_events(timeout=1)