Hugh Sasse's dRuby page

Purpose of this document | Other Sites about dRuby | Sites about Linda | Introduction | Rdoc docs for dRuby-2.0.4

Purpose of this document

The purpose of this page is to provide some documentation in English of the dRuby package, for myself and for others. It will be somewhat sparse to start with, and possible inaccurate in places, but it should improve with time.

Other Sites about dRuby

The main dRuby page is in Japanese.

Chad Fowler has an Intro to dRB, which describes how to use the package.

Distributed Ruby is also documented in the chapter Reflection, ObjectSpace, and Distributed Ruby of Programming Ruby by by David Thomas and Andrew Hunt Addison-Wesley Oct 2000 ISBN: 0201710897.

Ruby Developers Guide, Michael Neumann, Robert Feldt, Lyle Johnson
Syngress
ISBN 1928994644
has good information on DRuby, devoting several pages with example code to it..

Sites about Linda

The Linda programming paradigm is included here because of its applicability ro Rinda, which is part of dRuby.

The York Coordination (Linda) Group have a collection of papers online.

Rob Jackson's Research page has information on Contract-Linda.

Designing and Building Parallel Programs is a good online resource with some coverage of Linda.

Introduction

dRuby or dRB allows Ruby objects to be distributed across many machines over TCP/IP, i.e, over the internet or a LAN. The model utilised is that a server distributes a single "front" object, the methods of which can be used to create and access other objects.

Furthermore, clients of this server can pass local objects to the front object, and when the front object calls the methods of these objects, the code is executed on the client machine.

So how is this done? There are two answers to that. The first is that it doesn't matter, because the whole point of Object Oriented programming is encapsulation, so "one just doesn't ask that sort of thing." :-). The second answer is that the distribution is done by Marshalling the objects (converting them to some form which can be transmitted over the network), and some rather cunning interface design to make it all look easy. I have a way to go before I understand both these topics fully.

Here are the filenames with descriptions of their contents.


drb-1.3.6
doc
These are self explanatory (except to say that they are in RD format)...
acl-ref.rd
acl.rd
changelog.rd
drb-ref.rd
INSTALL
Installation instructions
install.rb
Installation script
lib
The library, as it will be installed:
drb
drb.rb
This defines the following things:
module DRb
class DRbIdConv
Implements a mapping between objects and references.
module DRbUndumped
overrides the method dump to raise an exception. Makes sure that objects including this module cannot be dumped.
class DRbServerNotFound
An error class
class DRbUnknownError
An error class. This class can be dumped and restored. (at the time of writing I believe this is so it can be passed over the network
class DRbUnknown
Another load/dumpable error type???
module DRbProtocol
this implements communication over TCP/IP.
class DRbObject
The class for objects served by the dRuby servers.
class DRbConn
This is concerned with managing a pool of connections (over sockets)
class DRbServer
The class for the object doing the serving. It has methods:
new(uri=nil, front=nil, acl=nil, idconv=nil)
if called with no arguments, or nil, nil sets up a server locally, to handle a remote object. For example:
aserver=DRb::DRbServer.new
ro = DRb::DRbObject.new(nil, remoteURI)
If supplied with an object will set that to the front object. The default URI is "druby://:0" which is the same as "druby://0.0.0.0:0", the latter seeming to be the most cited. However, I have had problems with this on windows, and "druby://localhost:0" seems to work for me at least within one machine. Examining the source further, it seems that leaving the host out altogether (druby://:0) is treated specially, and is the default case for when nil is used.
eq.rb
Extends module DRb by extending class DRbObject with equality methods ==, hash and eql?.
extserv.rb
Extends module DRb with class ExtServ, which is a dRuby server providing access to another server.
extservm.rb
Extends module DRb with class ExtServManager, This manages a queue of servers, and issues a command to each one in turn. [not entirely sure about this]
observer.rb
Extends module DRb with class DRbObservable, Using the Observer module, this updates all the observers that need updating.
rinda.rb
A Ruby implementation of the Linda method of parallel computing, whereby "tuples" are shared between processors.
defines class TupleSpaceProxy
allows a remote Tuplespace to appear as local. There is an example of its use in [Ruby-Talk:15023], which refers to the rindas.rb and rindac.rb files in the distribution.
timeridconv.rb
defines class TimerIdConv
converts a TimerHolder object between a reference and an object.
acl.rb

Access control lists. These allow blocking hosts according to IP address.

defines class ACL
has methods install_list(list) which takes a list of items, 2 by 2, and treats this as a pair of permissions, domain, where permissions is allow or deny. It assigns the domains to the appropriate instance variable.
defines class ACLEntry
This has instance variable @pat which is a variable length array holding [:all], [:ip, ipaddress] or [:name,qualified_hostname]
defines class ACLList
A list of ACLs
drb.rb
Just does require "drb/drb"
mutexm.rb
Extends a class with Mutex-like facilities.
simpletuple.rb

A simple implementation of tuplespace for Rinda

defines class SimpleTupleSpace
This has in and out methods.
timerholder.rb
Holds a hash of timers
tuplespace.rb

the full implementation of tuplespaces for Rinda

defines class TupleSpace
defines class Template
This holds a list of variable length i.e this is the definition of a tuple. It only has the method match which allows lists of the same length to match if each stored entry === that being matched. I.e. this is case. comparison. tuples within a space need not be equally long.
method out(tuple)AKA put,write
writes a tuple out to the tuplespace
method in(tuple, non_block=false)AKA get,take
reads a matching tuple in from the tuplespace, and deletes it from the tuplespace
method rd(tuple, non_block=false)AKA read
reads a matching tuple in from the tuplespace, and does not delete it from the tuplespace
method mv(dest, tuple, non_block=false)AKA move
reads a matching tuple in from the tuplespace, deletes it and writes to the dest space. If this fails, it writes it back to the original tuplespace
runit
Unit tests:
acl-test.rb
drbunit.rb
linda_test.rb
mutexm_unit.rb
ut_array.rb
ut_drb.rb
ut_large.rb
ut_port.rb
ut_safe1.rb
sample
README.rd
cgi_drb.rb
darray.rb
darrayc.rb
dbiff.rb
dcdbiff.rb
dchatc.rb
dchats.rb
dhasen.rb
dhasenc.rb
dlogc.rb
dlogd.rb
dqin.rb
dqlib.rb
dqout.rb
dqueue.rb
drbc.rb
drbch.rb
drbs-acl.rb
drbs.rb
extserv_test.rb
holderc.rb
holders.rb
http.rb
name.rb
namec.rb
rindac.rb
rindas.rb
speedc.rb
speeds.rb


Created 02-SEP-2002 by Hugh Sasse

Previously Modified 07-AUG-2003 by Hugh Sasse

Last Modified 19-NOV-2012 by Hugh Sasse

It is possible to re-validate this document.

$Id: index.html,v 1.13 2012/11/19 16:36:58 hgs Exp hgs $