Drb example

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?

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.

Chris

···

On 10/11/05, snacktime <snacktime@gmail.com> wrote:

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?

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.

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.

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 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.

···

On Oct 12, 2005, at 2:28 PM, snacktime wrote:

On 10/11/05, snacktime <snacktime@gmail.com> wrote: