Skip to content

Commit

Permalink
Change receive_messages_from_queue's max_count to 10
Browse files Browse the repository at this point in the history
It doesn't make a lot of sense to default max_count to 1, since one can
also receive a single message with receive_message_from_queue. The name
of the method also implies that it returns multiple messages, so having
it default to returning 1 message is a bit counterintuitive.
  • Loading branch information
Ville Lindroos committed Aug 31, 2021
1 parent d3b0fd3 commit 003e317
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqs_poller/sqs_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ def purge_queue(self, queue_name):
queue = self.get_queue_by_name(queue_name)
return queue.purge()

def receive_messages_from_queue(self, queue_name, max_count=1, **receive_kwargs):
def receive_messages_from_queue(self, queue_name, max_count=10, **receive_kwargs):
"""Return maximum of `max_count` messages from a queue named `queue_name`.
:param str queue_name: Name of the queue.
:param int max_count: Maximum number of messages to receive.
:param int max_count: Maximum number of messages to receive (10 at most).
:param receive_kwargs: Arguments that will be passed to the underlying
`receive_messages` call.
:raise QueueDoesNotExist: When the queue is not found, this exception is raised.
Expand Down

0 comments on commit 003e317

Please sign in to comment.