Skip to content

Instantly share code, notes, and snippets.

@gerred
Created April 21, 2011 13:20
Show Gist options
  • Save gerred/934456 to your computer and use it in GitHub Desktop.
Save gerred/934456 to your computer and use it in GitHub Desktop.
A Little Bunny Example
require 'bunny'
b = Bunny.new(:logging => true)
b.start
exchange = b.exchange('hello_reddirt', :type => :fanout)
q = b.queue('my_queue')
q.bind(exchange)
exchange.publish({"This":"is some json"})
puts q.pop[:payload] # => "{"This":"is some json}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment