Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: added a method to determine whether the consumer should be executed #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sqs_listener/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,15 @@ def _initialize_client(self):
self._queue_url = qs['QueueUrl']
return sqs

def _condition_to_listening(self):
"""
Return condition to run listening process.
"""
return True

def _start_listening(self):
# TODO consider incorporating output processing from here: https://github.com/debrouwere/sqs-antenna/blob/master/antenna/__init__.py
while True:
while self._condition_to_listening():
# calling with WaitTimeSecconds of zero show the same behavior as
# not specifiying a wait time, ie: short polling
messages = self._client.receive_message(
Expand Down