Skip to content

Instantly share code, notes, and snippets.

@careo
Created March 12, 2009 16:48
Show Gist options
  • Select an option

  • Save careo/78160 to your computer and use it in GitHub Desktop.

Select an option

Save careo/78160 to your computer and use it in GitHub Desktop.
require 'mq'
require 'pp'
EM.run {
def log *args
p args
end
mq = MQ.new
spam = mq.queue("my spam").bind(mq.topic("spam"))
EM.add_periodic_timer(5) do
spam.status { |m,c|
puts m
puts c
}
end
spam.subscribe { |i|
log :read_spam, i
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment