From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2001-11-26T08:25:15+09:00 Subject: [ruby-talk:26474] DRbUndumped question I'm using dRuby and I have a Client object which runs on a remote machine and is bound by dRuby to a port on that machine. I want to pass a Task object to the Client object on the remote machine and have the Task object 'run' itself there. here's part of the Client.rb file: require 'drb' class Client def initialize ... end def run(taskObj, *args) taskObj.run(args) #an object that must respond to 'run' end end if $0 == __FILE__ clientObj = Client.new DRb.start_service('druby://0.0.0.0:9000',clientObj) DRb.thread.join end #end of Client.rb Here's the Task.rb file which defines a Task class and then attempts to send a Task object to Client running on 'remote': require 'drb' class Task include DRb::DRbUndumped def initialize end def run(*args) puts "Task::Run - running #{args}" end end if $0 == __FILE__ DRb.start_service() client = DRbObject.new(nil,'druby://remote:9000') puts client.run(Task.new, "ftp","xyz","abc") end #end of Task.rb Now, if I'm running Client.rb on the remote machine (called 'remote') and Task.rb on the local machine, I would have expected to see the message: Task::Run - running ftpxyzabc on the STDOUT of the remote machine, instead I see it on the local machine - not what I want, I want to have the Task object run on the remote machine. If I comment out the 'include DRb::Undumped' line in Task.rb and add 'require Task.rb' to the top of Client.rb (and make sure that Task.rb is available on the remote machine - which is, of course the drawback of this alternative) it works as I would expect (and want) - the message is printed on the remote machine. So, my question is, what exactly does including DRbUndumped do? (I thought it was to mixin to your own classes so that they could be passed by reference to the remote DRbObject, but now I think I misunderstand how to use it). Phil