Skip to content

Commit

Permalink
Improved README
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Van Dyk committed Apr 19, 2011
1 parent 4018b50 commit 45dfbd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README
@@ -1,22 +1,26 @@
require 'roger_rabbit'


# 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

# RPC with result directly returned
# Sending an RPC message
result = RogerRabbit.rpc_message("another-queue", :joe => "cool")
# result is { :joe => "cool", :true => "true" }


# RPC with result returned in a block
# Sending an RPC message with result as block
RogerRabbit.rpc_message("another-queue", :joe => "cool") do |result|
# result is { :joe => "cool", :true => "true" }
end

0 comments on commit 45dfbd4

Please sign in to comment.