[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

DRb Question

Joe Van Dyk

4/22/2005 9:33:00 PM

I have an object that's available via DRb. The class makes available
several strings and arrays for client viewing.

I can access methods on the server that return strings fine. However,
I'm having difficulties accessing Array objects that are returned by
the server. The client code doesn't know anything about the main
server object, btw.

Any ideas?

Thanks,
Joe



4 Answers

Eric Hodel

4/22/2005 9:44:00 PM

0

On 22 Apr 2005, at 14:32, Joe Van Dyk wrote:

> I have an object that's available via DRb. The class makes available
> several strings and arrays for client viewing.
>
> I can access methods on the server that return strings fine. However,
> I'm having difficulties accessing Array objects that are returned by
> the server. The client code doesn't know anything about the main
> server object, btw.
>
> Any ideas?

Do you include DRbUndumped in all the classes that don't exist on both
sides?

What is in the Arrays you return?

Just Ruby core objects, or other objects?

--
Eric Hodel - drbrain@segment7.net - http://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Joe Van Dyk

4/22/2005 9:56:00 PM

0

On 4/22/05, Eric Hodel <drbrain@segment7.net> wrote:
> On 22 Apr 2005, at 14:32, Joe Van Dyk wrote:
>
> > I have an object that's available via DRb. The class makes available
> > several strings and arrays for client viewing.
> >
> > I can access methods on the server that return strings fine. However,
> > I'm having difficulties accessing Array objects that are returned by
> > the server. The client code doesn't know anything about the main
> > server object, btw.
> >
> > Any ideas?
>
> Do you include DRbUndumped in all the classes that don't exist on both
> sides?

No.

>
> What is in the Arrays you return?
>
> Just Ruby core objects, or other objects?

Other objects.



Joe Van Dyk

4/22/2005 9:58:00 PM

0

On 4/22/05, Joe Van Dyk <joevandyk@gmail.com> wrote:
> On 4/22/05, Eric Hodel <drbrain@segment7.net> wrote:
> > On 22 Apr 2005, at 14:32, Joe Van Dyk wrote:
> >
> > > I have an object that's available via DRb. The class makes available
> > > several strings and arrays for client viewing.
> > >
> > > I can access methods on the server that return strings fine. However,
> > > I'm having difficulties accessing Array objects that are returned by
> > > the server. The client code doesn't know anything about the main
> > > server object, btw.
> > >
> > > Any ideas?
> >
> > Do you include DRbUndumped in all the classes that don't exist on both
> > sides?
>
> No.
>
> >
> > What is in the Arrays you return?
> >
> > Just Ruby core objects, or other objects?
>
> Other objects.

Fixed.. had to include DRbUndumped in the other classes that were in the arrays.

Thanks!



Joe Van Dyk

4/22/2005 10:29:00 PM

0

On 4/22/05, Joe Van Dyk <joevandyk@gmail.com> wrote:
> I have an object that's available via DRb. The class makes available
> several strings and arrays for client viewing.
>
> I can access methods on the server that return strings fine. However,
> I'm having difficulties accessing Array objects that are returned by
> the server. The client code doesn't know anything about the main
> server object, btw.
>
> Any ideas?
>

Here's another question regarding threads and DRb:

Every second, a function in the class that's being made available via
DRb should be called automatically. How would I do that?

So I'd have

class Server
def update
# stuff gets updated
end
end

server = DRb.start_service....
# start threads that call server.update every second
DRb.thread.join