Skip to content

Instantly share code, notes, and snippets.

Created July 24, 2008 19:26
Show Gist options
  • Save anonymous/2260 to your computer and use it in GitHub Desktop.
Save anonymous/2260 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mq'
EM.run do
def log(*args)
p args
end
# AMQP.logging = true
all = MQ.new.fanout('all')
amq = MQ.new
amq.queue('serv').subscribe do |msg|
log :recv, msg
all.publish(msg)
end
amq = MQ.new
amq.queue('c1').bind(all)
amq.queue('c2').bind(all)
amq.queue('c3').bind(all)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment