INNER CODE UNIT · Python
check_queue
miztiik/AWS-Demos · how-to-examples/iam-s3-sqs-sns-video-transcoder.py:416
def check_queue(self):
"""
Check the queue for completed files and set them to be
downloaded.
"""
queue = self.queue
to_fetch = []
for msg in queue.receive_messages(WaitTimeSeconds=self.poll_interval):
body = json.loads(msg.body)
message = body.get('Message', '{}')
outputs = json.loads(message).get('outputs', [])
if not len(outputs):
print("Saw no output in {0}".format(body))
continue
key = outputs[0].get('key')