Module: BunnyHop::ControllerHelper

Defined in:
lib/bunny_hop.rb

Instance Method Summary collapse

Instance Method Details

#on(queue) ⇒ Object



62
63
64
65
66
67
68
# File 'lib/bunny_hop.rb', line 62

def on(queue)
  @__bunny ||= BunnyHop.new
  puts "subscribe to #{queue}"
  @__bunny.subscribe(queue.to_s) do |payload|
    yield(payload)
  end
end