Forum: Ruby passing to with drb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Larz (Guest)
on 2009-01-08 17:30
(Received via mailing list)
I've been finding it easiest to pass hashes and arrays to DRb
processes because of what it can marshal. It would be nice if I could
pass a Struct or something as hash notation is extra verbose and I'd
like to be able to use the 'dot' notation. I guess I'd have to use
some sort of hash to Struct conversion after recieving the hash,
anyone else thought about that type of thing ?
Brian C. (Guest)
on 2009-01-09 00:05
Larz wrote:
> I've been finding it easiest to pass hashes and arrays to DRb
> processes because of what it can marshal. It would be nice if I could
> pass a Struct or something as hash notation is extra verbose and I'd
> like to be able to use the 'dot' notation. I guess I'd have to use
> some sort of hash to Struct conversion after recieving the hash,
> anyone else thought about that type of thing ?

No need, you can pass your native struct (or any other Ruby class).
However both client and server processes need the class definition. If
you stick this in a file which they both require, then the job is done.
This topic is locked and can not be replied to.