Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

wrapper around the bunny / rabbitmq gem

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 roger_rabbit.gemspec
README
roger_rabbit is a wrapper around the bunny rabbitmq gem
that makes doing things with rabbitmq simple.

The point is to come up with a set of conventions that make
rabbitmq services easy to configure, maintain, develop, and 
test.

# Messages are transmitted as json.  Deserialized as
# ActiveSupport::HashWithIndifferentAccess.

# Publishing a message, don't care about result.
RogerRabbit.publish "queue-name", :joe => "cool"

# Consuming the above message.
RogerRabbit.consume "queue-name" do |msg|
  # msg is { :joe => "cool" }
end


# Listening for a RPC message.
RogerRabbit.rpc_listen("another-queue") do |args|
  args.merge({:true => true})
end
  
# Sending an RPC message
result = RogerRabbit.rpc_message("another-queue", :joe => "cool")
# result is { :joe => "cool", :true => "true" }


# Sending an RPC message with result as block
RogerRabbit.rpc_message("another-queue", :joe => "cool") do |result|
  # result is { :joe => "cool", :true => "true" }
end
Something went wrong with that request. Please try again.