examples/mq/clock.rb in amqp-0.6.0 vs examples/mq/clock.rb in amqp-0.6.4
- old
+ new
@@ -1,9 +1,9 @@
$:.unshift File.dirname(__FILE__) + '/../../lib'
require 'mq'
-EM.run{
+AMQP.start(:host => 'localhost') do
def log *args
p args
end
@@ -26,10 +26,10 @@
amq.queue('every 5 seconds').bind(amq.fanout('clock')).subscribe{ |time|
time = Marshal.load(time)
log 'every 5 seconds', :received, time if time.strftime('%S').to_i%5 == 0
}
-}
+end
__END__
[:publishing, Thu Jul 17 20:14:00 -0700 2008]
["every 5 seconds", :received, Thu Jul 17 20:14:00 -0700 2008]