Class: Tackle::Consumer::Queue
- Inherits:
-
Object
- Object
- Tackle::Consumer::Queue
- Defined in:
- lib/tackle/consumer/queue.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #create_amqp_queue ⇒ Object
-
#initialize(name, options, connection, logger) ⇒ Queue
constructor
A new instance of Queue.
Constructor Details
#initialize(name, options, connection, logger) ⇒ Queue
Returns a new instance of Queue.
7 8 9 10 11 12 13 14 |
# File 'lib/tackle/consumer/queue.rb', line 7 def initialize(name, , connection, logger) @name = name @connection = connection @logger = logger @options = @amqp_queue = create_amqp_queue end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/tackle/consumer/queue.rb', line 5 def name @name end |
Instance Method Details
#create_amqp_queue ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/tackle/consumer/queue.rb', line 16 def create_amqp_queue @logger.info("Creating queue '#{@name}'") @connection.channel.queue(@name, @options) rescue Exception => ex @logger.error "Failed to create queue '#{ex}'" raise ex end |