Process 20 messages at the same time

This commit is contained in:
Zoe Roux 2024-04-09 00:22:45 +02:00
parent 52380bcb29
commit 8da6085df0
No known key found for this signature in database

View File

@ -49,4 +49,7 @@ class Subscriber:
else:
await message.nack(requeue=False)
await self._queue.consume(on_message, no_ack=True)
# Allow up to 20 scan requests to run in parallel on the same listener.
# Since most work is calling API not doing that is a waste.
await self._channel.set_qos(prefetch_count=20)
await self._queue.consume(on_message)