The rserve module provides a distributed "shelve" for Python, using
the Pyro library (http://pyro.sourceforge.net/).
(It makes use of the remote extension module Pyro.ext.remote)

To start, run an rserve-broker on a publically accessible machine,
giving the IP address of the public interface to both (in most cases,
these options are not required and both programs will pick the
correct interface):

  $ ./rserve-broker --host <IP address of eth0/ppp0>

It takes a few seconds to start because it is also starting
a Name Server for you (you don't have to do this yourself!)

Clients may now connect and use the rserve broker on that machine.
The basic usage is:

  import rserve

  dict = rserve.connect("hostname-of-broker")

  dict[key] = object/value/whatever

At this point, other clients may connect in the same fashion, and pick
out whatever you've put in the rserve dictionary.

NOTE: By default, any class objects handed to the broker are
referenced by proxy.  This means that if another client obtains a copy
of that proxy and makes a method call, _it expects the original client
to service the call_.  For this to happen, the original client must
listen in a thread for calls to its published objects.  To handle
requests, call:

  rserve.serve()

This can be done in a thread, as long as the code being published is
also thread-safe.

If you want object to be placed in the rserve by copying them, call
rserve.copied(type) for each kind of type that should be copied, or
just call rserve.copied() to copy all types.

That's it!  Happy distributed computing.

John Wiegley <johnw@newartisans.com>


p.s. There's an example in the distrubtion.  To use it, run a broker
     on machine foo and then from anywhere run first example-a, and
     then example-b (example-a publishes methods by proxy that it then
     serves):

   python example-a.py hostname-of-broker
   python example-b.py hostname-of-broker
