From: Jeff Wood Date: 2005-10-14T20:09:29+09:00 Subject: Re: Challenging Project ... Need a deep guru to provide enlightenment. ------=_Part_15915_7806665.1129288166865 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Or to be specifically accurate, DRbObjects aren't transparent enough ... they don't provide you with the list of available functionality appropriately. On 10/14/05, Jeff Wood wrote: > > Actually I wrote a new chunk of code based on Ara's snippet that for > direct calls does EXACTLY what I want it to ... I'll be posting it later > today ... I just have to deal with stuff like blah.call.call2.call3 ... > which I don't believe will currently work ... I'll have to dig through an= d > see how DRb makes it work ... > DRbObjects don't work ... call methods or call respond_to? ... they are > NOT calls on the remote object ... I don't believe ANY call on a proxied > object should be local, they should ALL be passed over the wire ( and yes= , I > know that at least id and send can't, but everything other than those ). > I really think you guys will like the stuff I have ... So far, I'm > calling it Roxy ... > Thanks. > j. > > On 10/13/05, ES wrote: > > > > Jeff Wood wrote: > > > These are a good start, but what I'm really trying to do is come up > > with a > > > completely clean way to do DRb ... > > > > It really helps when you say what you actually want to do :) > > > > It seems as if the DRb object already works just like you want > > except that it says it is a DRbObject when you do #inspect or > > something? Or is there some other functionality that you need? > > > > > Don't get me wrong, I love DRb for what it is, but I want transparent > > proxy. > > > > > > So, I want to be able to do DRb::Proxy.new( "druby://add.ress:1234" ) > > > > > > and get back an object I can call methods on ... that will report it > > self as > > > whatever the Proxy is proxying not DRbObject ... > > > > > > Does that make sense? I am wanting to be able to use irb with DRb and > > get > > > live auto-completion across the wire ... > > > > > > I figure a transparent proxy is the ONLY way ... > > > > > > let me know if I'm going down the wrong path. > > > > > > j. > > > > > > On 10/13/05, Ara.T.Howard wrote: > > > > > >>On Fri, 14 Oct 2005, Ara.T.Howard wrote: > > >> > > >> > > >>>this'll be a good start: > > >> > > >> > > >> > > >>scratch that - try this: > > >> > > >>harp:~ > cat a.rb > > >>module Proxy > > >>def self::new obj > > >>klass =3D Class::new do > > >>ignore =3D %w( __send__ __id__ ) > > >> > > >>obj.class.instance_methods.each do |m| > > >>next if ignore.include? m > > >>module_eval <<-code > > >>def #{ m } *a, &b > > >>__obj.send "#{ m }", *a, &b > > >>end > > >>code > > >>end > > >> > > >>attr_accessor '__obj' > > >> > > >>def initialize obj > > >>self.__obj =3D obj > > >>end > > >> > > >>self > > >>end > > >>klass::new obj > > >>end > > >>end > > >> > > >>a =3D String::new 'forty-two' > > >>b =3D Proxy::new a > > >> > > >>p a.class > > >>p b.class > > >> > > >>p(a.methods =3D=3D b.methods) > > >> > > >>p b.upcase > > >> > > >> > > >>harp:~ > ruby a.rb > > >>String > > >>String > > >>true > > >>"FORTY-TWO" > > >> > > >> > > >>-a > > >>-- > > >> > > > > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > >>| email :: ara [dot] t [dot] howard [at] noaa [dot] gov > > >>| phone :: 303.497.6469 > > >>| Your life dwells amoung the causes of death > > >>| Like a lamp standing in a strong breeze. --Nagarjuna > > >> > > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > > >> > > >> > > >> > > > > > > > > > > > > -- > > > "http://ruby-lang.org -- do you ruby?" > > > > > > Jeff Wood > > > > > > > > > > > > -- > "http://ruby-lang.org -- do you ruby?" > > Jeff Wood > -- "http://ruby-lang.org -- do you ruby?" Jeff Wood ------=_Part_15915_7806665.1129288166865--