Class: Mimi::Messaging::SQS_SNS::TemporaryQueueConsumer
- Inherits:
-
Object
- Object
- Mimi::Messaging::SQS_SNS::TemporaryQueueConsumer
- Defined in:
- lib/mimi/messaging/sqs_sns/temporary_queue_consumer.rb
Overview
Temporary queue consumer creates a temporary queue and attaches to it. The queue will be deleted on consumer shutdown.
Instance Attribute Summary collapse
-
#queue_url ⇒ Object
readonly
Returns the value of attribute queue_url.
Instance Method Summary collapse
-
#initialize(adapter, queue_name, &block) ⇒ TemporaryQueueConsumer
constructor
A new instance of TemporaryQueueConsumer.
- #stop ⇒ Object
Constructor Details
#initialize(adapter, queue_name, &block) ⇒ TemporaryQueueConsumer
Returns a new instance of TemporaryQueueConsumer.
14 15 16 17 18 |
# File 'lib/mimi/messaging/sqs_sns/temporary_queue_consumer.rb', line 14 def initialize(adapter, queue_name, &block) @adapter = adapter @queue_url = adapter.find_or_create_queue(queue_name) @consumer = Consumer.new(adapter, @queue_url, &block) end |
Instance Attribute Details
#queue_url ⇒ Object (readonly)
Returns the value of attribute queue_url.
12 13 14 |
# File 'lib/mimi/messaging/sqs_sns/temporary_queue_consumer.rb', line 12 def queue_url @queue_url end |