Last active
October 19, 2015 15:44
-
-
Save kdeloach/2790ed9125b00a46ceb2 to your computer and use it in GitHub Desktop.
Consume SQS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
from __future__ import division | |
import sys | |
import boto.sqs | |
conn = boto.sqs.connect_to_region('us-east-1') | |
q = conn.get_queue('foo') | |
while True: | |
message = q.read() | |
if not message: | |
continue | |
print(message.get_body()) | |
sys.stdout.flush() | |
q.delete_message(message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment