Skip to content

Instantly share code, notes, and snippets.

@pjhyett
Forked from bmizerany/server.rb
Created October 23, 2008 01:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pjhyett/18892 to your computer and use it in GitHub Desktop.
Save pjhyett/18892 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mq'
require 'json'
EM.run do
AMQP.start(:vhost => '/heroku',
:user => 'face',
:pass => 'thisisheroku!')
MQ.queue('wtf').bind(MQ.topic("asdf")).subscribe do |r|
p r
end
end
require 'rubygems'
require 'mq'
require 'json'
EM.run do
AMQP.start(:vhost => '/heroku',
:user => 'face',
:pass => 'thisisheroku!')
MQ.topic("asdf").publish({ :domain => 'asdflkasjdflkj' }.to_json)
EM.add_timer(1) { EM.stop_event_loop }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment