drb example

S

snacktime

------=_Part_26201_30866782.1129080673587
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I've been trying to find a drb example that illustrates a client obtaining
an object from a drb server, and being able to then use that object on the
client side like any other object. I've seen bits and pieces but nothing
that's made sense to me so far. Most of the examples just show retrieving
the value of a method call, which seems to be a lot different then
retrieving an object itself.

Anyone have a simple example anywhere?

------=_Part_26201_30866782.1129080673587--
 
S

snacktime

------=_Part_30250_14653840.1129098527471
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I've been trying to find a drb example that illustrates a client obtainin= g
an object from a drb server, and being able to then use that object on th= e
client side like any other object. I've seen bits and pieces but nothing
that's made sense to me so far. Most of the examples just show retrieving
the value of a method call, which seems to be a lot different then
retrieving an object itself.

Anyone have a simple example anywhere?
Ok after thinking I just wasn't getting it I found out my problem was
elsewhere. However this raised another question. My client was calling a
method which returned a cloned copy of an array that had been extended by
MonitorMixin. It came across in the client as a DRb::DRbUnknown. Is there a
cleaner way to make a copy of an extended object that is compatible with dr=
b
other than iterating over it in a block? Not a huge deal, just curious.

Chris

------=_Part_30250_14653840.1129098527471--
 
E

Eric Hodel

There is no difference between the two. But! You must have the same
classes loaded on both sides or have DRb::DRbUndumped added to the
classes on the end with the classes loaded.
Ok after thinking I just wasn't getting it I found out my problem was
elsewhere. However this raised another question. My client was
calling a
method which returned a cloned copy of an array that had been
extended by
MonitorMixin. It came across in the client as a DRb::DRbUnknown. Is
there a
cleaner way to make a copy of an extended object that is compatible
with drb
other than iterating over it in a block? Not a huge deal, just
curious.

You must either have MonitorMixin on both sides of the connection or
include DRb::DRbUndumped into the class on the server side.

http://segment7.net/projects/ruby/drb/introduction.html

May be of interest to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,975
Members
47,533
Latest member
medikillz39

Latest Threads

Top