require 'rubygems'
require 'mq'

event_loop = Thread.new do
  EM.run do
    EM.add_timer(1) do
      EM.stop
    end
  end
end

conn = AMQP::connect :host => '192.168.1.120', :port => 5672, :user => 'guest', :password => 'guest', :vhost => '/'
# conn = AMQP::connect :host => 'localhost', :port => 5672, :user => 'guest', :password => 'guest', :vhost => '/'
amq = MQ.new conn
amq.queue("hello.world.queue").subscribe do |login|
  puts login
end

event_loop.join
