Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (17 sloc) 434 Bytes
#!/usr/bin/env ruby
require 'bunny'
connection = Bunny.new
connection.start
channel = connection.create_channel
exchange = channel.fanout('logs')
queue = channel.queue('', exclusive: true)
queue.bind(exchange)
puts ' [*] Waiting for logs. To exit press CTRL+C'
begin
queue.subscribe(block: true) do |_delivery_info, _properties, body|
puts " [x] #{body}"
end
rescue Interrupt => _
channel.close
connection.close
end