From: yangpeng Date: 2008-02-01T10:00:55+09:00 Subject: Re: DRB+Mixin, a defect or an usage error? --_08e5c2c5-631e-4437-86d3-51333d3fa2f2_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit yeah, then how can I report this defect, if it is a defect? > Date: Fri, 1 Feb 2008 02:40:02 +0900> From: devi.webmaster@gmail.com> Subject: Re: DRB+Mixin, a defect or an usage error?> To: ruby-talk@ruby-lang.org> > 2008/1/30 yangpeng :> > > I found a strange thing when I include a module to a Drb object.> > I'm confused.> >> > module_a.rb:> >> > require 'drb'> > module TestModule1> > def sayHello2> > puts "who am i"> > end> > end> >> > server.rb:> >> > require 'drb'> > require 'module_a'> >> > class ServerHello> > include TestModule1> > def sayHello> > puts 'I am server'> > end> > end> >> > DRb.start_service("druby://127.0.0.1:2222", ServerHello.new)> > DRb.thread.join> >> >> > client.rb:> >> > require 'drb'> > require 'module_a'> > include TestModule1> > DRb.start_service> > info = DRbObject.new(nil, "druby://127.0.0.1:2222")> > info.sayHello()> > info.sayHello2> >> > The three files in one path, I run server.rb first, then client.rb.> > The result is> >> > server.rb output:> > I am server> >> > client.rb output:> > who am i> >> > But my expected result is:> >> > server.rb output both "I am server" and "who am i"> >> > the "sayHello2" is executed in local, not remote. (or exactly, it's "client invoke server, server invoke client backly",> > for if we changed "puts "who am i"" to "puts self", the result is "DRbObject")> > If I comments the "include TestModule1" of client.rb, the result is good.> > But this is not I want, for there are many standard code share between server and client.> > It's it a defect or my usage error> > > Wow, this is surprising. I would really appreciate some enlightenment> by somebody more experienced with DRB, but I would call this a bug.> > Daniel Brumbaugh Keeney> _________________________________________________________________ MSN������������������������������������������ http://im.live.cn/emoticons/?ID=18 --_08e5c2c5-631e-4437-86d3-51333d3fa2f2_--