Ruby RPC

Introduction

Ruby RPC is an alternative to DRb. It provides a similar service, but in a way that is slightly more compatible with my way of thinking. It dispenses with the URL syntax and some of the complexity of DRb and adds automatic distributed reference counting garbage collection. This prevents the problem seen in DRb where objects disappear when there are no local references to them. The interface is also designed to be simple and transparent, with a minimum of programmer work needed to use it.

Ruby RPC was developed and is maintained by Brian Ollenberger. If you need to contact me, see the contact link above.

Features

Ruby RPC has the following features and characteristics:

Example

In order to use Ruby RPC, you need to create at least one server, and connect to it from one or more clients. A simple example follows.

# Server
require 'rpc'
server_object = {}
Server.new(server_object)

And the clients:

# Client 1
require 'rpc'
c = Connection.new('localhost')
c['key'] = 'value'
c.join
# Client 2
require 'rpc'
c = Connection.new('localhost')
puts c['key'].to_s

If you run client number one, it will set c['key'] to be the string 'value'. Client one will wait and client two will then connect and output "value".

Download Ruby RPC

Ruby RPC is included in the Ruby ODB package. Download it below or from the ODB page.