Class: Gorgon::AmqpService
- Inherits:
-
Object
- Object
- Gorgon::AmqpService
- Defined in:
- lib/gorgon/amqp_service.rb
Instance Method Summary collapse
-
#initialize(connection_config) ⇒ AmqpService
constructor
A new instance of AmqpService.
- #start_worker(file_queue_name, reply_exchange_name) ⇒ Object
Constructor Details
#initialize(connection_config) ⇒ AmqpService
Returns a new instance of AmqpService.
29 30 31 |
# File 'lib/gorgon/amqp_service.rb', line 29 def initialize connection_config @connection_config = connection_config.merge(:spec => "09") end |
Instance Method Details
#start_worker(file_queue_name, reply_exchange_name) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/gorgon/amqp_service.rb', line 33 def start_worker file_queue_name, reply_exchange_name GorgonBunny.run @connection_config do |b| queue = b.queue(file_queue_name, :auto_delete => true) exchange = b.exchange(reply_exchange_name, :auto_delete => true) yield AmqpQueueDecorator.new(queue), AmqpExchangeDecorator.new(exchange) end end |