Skip to content

Instantly share code, notes, and snippets.

@kdeloach
Last active October 19, 2015 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdeloach/2790ed9125b00a46ceb2 to your computer and use it in GitHub Desktop.
Save kdeloach/2790ed9125b00a46ceb2 to your computer and use it in GitHub Desktop.
Consume SQS
# -*- 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