Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
Minor start towards AutoscalingQueue work
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Hatfield committed Sep 5, 2012
1 parent 9011393 commit d25d14e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/clientqueue/queue.py
Expand Up @@ -28,12 +28,12 @@ class SQSQueue(Queue):

def __init__(self, queue_name, access_key, secret_key):
self.name = queue_name
self.connection = boto.sqs.connection.SQSConnection(access_key, secret_key)
self.queue = self.connection.get_queue(queue_name)
self.sqs = boto.sqs.connection.SQSConnection(access_key, secret_key)
self.queue = self.sqs.get_queue(queue_name)

if self.queue is None:
logging.info("Creating queue: %s", queue_name)
self.queue = self.connection.create_queue(queue_name)
self.queue = self.sqs.create_queue(queue_name)

self.queue.set_message_class(boto.sqs.message.RawMessage)

Expand Down Expand Up @@ -61,7 +61,7 @@ def __len__(self):
class AutoscalingQueue(SQSQueue):
"""
This class should override the __init__ method of the SQSQueue class.
The purposes of overriding the init method is to additionally set up SNS topics,
The purpose of overriding the init method is to additionally set up SNS topics,
then link the queue and the topic together.
Creates SNS Topic with name like DC
Expand All @@ -70,4 +70,5 @@ class AutoscalingQueue(SQSQueue):
Adds SQS Permissions to SQS Queue with SNS's ARN
"""
def __init__(self, queue_name, access_key, secret_key):
pass
SQSQueue.__init__(self, queue_name, access_key, secret_key)
self.sns = boto.sns.SNSConnection(access_key, secret_key)

0 comments on commit d25d14e

Please sign in to comment.