Skip to content

Instantly share code, notes, and snippets.

@tmm1
Forked from anonymous/gist:2260
Created July 24, 2008 19:27
Show Gist options
  • Save tmm1/2261 to your computer and use it in GitHub Desktop.
Save tmm1/2261 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mq'
EM.run do
def log(*args)
p args
end
amq = MQ.new
amq.queue('serv').subscribe do |msg|
log :recv, msg
amq.fanout('all').publish(msg)
end
amq = MQ.new
all = amq.fanout('all')
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