Sha256: 13df5346e4d5d79d0c1d3e78ef731799e4d10560e083bda2ff48224b0c887c3b
Contents?: true
Size: 661 Bytes
Versions: 5
Compression:
Stored size: 661 Bytes
Contents
module Propono class QueueSubscription include Sns include Sqs attr_reader :topic_arn, :queue def self.create(topic_id) new(topic_id).tap do |subscription| subscription.create end end def initialize(topic_id) @topic_id = topic_id end def create @topic = TopicCreator.find_or_create(@topic_id) @queue = QueueCreator.find_or_create(queue_name) sns.subscribe(@topic.arn, @queue.arn, 'sqs') end def queue_name @queue_name ||= "#{config.application_name.gsub(" ", "_")}-#{@topic_id}" end private def config Configuration.instance end end end
Version data entries
5 entries across 5 versions & 1 rubygems