Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Redis RPC is a library for executing remote procedure calls through queues (lists) in redis.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time



Redis RPC is a library for executing remote procedure calls through queues (lists) in redis. The main purpose of this is to allow for queueing service requests and allow for downtime of internal services.

This is a work in progress. I can change whatever I want still.



$ [sudo] gem install redis_rpc


$ git clone git://
$ cd redis_rpc && gem build redis_rpc.gemspec
$ gem install redis_rpc-<version>.gem



Create a redis connection, define your service class, and start the server. The call to will block indefinitely.

require 'redis_rpc/server'

redis = Redis.connect(:url => 'redis://')

class Service
  def say_hello
    "Hello World"

  def boom
    raise "BOOM"
end, :redis => redis)


Establishing a client is very similar. Establish a connection to redis and hand it to the client factory. The service name you pass should be the class name of the service you wish to call on the server side.

Note that the client needs a source for random data (to name the response queue). Any of the the following will work... require 'securerandom' #ruby 1.9 require 'openssl' require 'active_support/secure_random'

require 'redis_rpc/client'
require 'openssl'

redis = Redis.connect(:url => 'redis://')

client ='Service', :redis => redis)



Currently all marshalling is handled by msgpack. This means it is extremely fast, but limited in what it can handle. All basic ruby types are handled automatically (true, false, nil, FixNum, BigNum, String, Array, Hash). This means that method arguments, and method results have to be rather simple right now.


If you'd like to hack on redis_rpc, start by forking the repo on GitHub:

The best way to get your changes merged back into core is as follows:

  1. Clone down your fork
  2. Create a thoughtfully named topic branch to contain your change
  3. Hack away
  4. Add tests and make sure everything still passes by running rake
  5. If you are adding new functionality, document it in the README
  6. Do not change the version number, we will do that on our end
  7. If necessary, rebase your commits into logical chunks, without errors
  8. Push the branch up to GitHub
  9. Send a pull request for your branch
Something went wrong with that request. Please try again.