# Challenging Project ... Need a deep guru to provide enlightenment

**URL:** <https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550>\
**Category:** ruby-talk\
**Created:** [13 October 2005 22:30 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550 "2005-10-13T22:30:50Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![7rans](https://avatars.discourse-cdn.com/v4/letter/7/a8b319/32.png) [@7rans](https://rubytalk.org/u/7rans)\
**Post date:** [14 October 2005 02:56 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/21 "2005-10-14T02:56:54Z")

</div>

Actually, I just went ahead and added a Proxy class to Facets (btw aka  
Nano Methods and Mega Modules). Very easy:

require 'facet/blankslate'

class Proxy \< BlankSlate

&nbsp;&nbsp;def initialize( obj )  
&nbsp;&nbsp;&nbsp;&nbsp;@self = obj  
&nbsp;&nbsp;end

&nbsp;&nbsp;def method\_missing( sym, \*args, &blk )  
&nbsp;&nbsp;&nbsp;&nbsp;@self.\_\_send\_\_( sym, \*args, &blk )  
&nbsp;&nbsp;end

end

What's esspeically nice about this is you can still get to the Proxy  
itself.

irb(main):001:0\> require 'facet/proxy'  
=\> true  
irb(main):002:0\> a = "Hello Dog"  
=\> "Hello Dog"  
irb(main):003:0\> ap = Proxy.new( a )  
=\> #\<Proxy:0xb7c21064 @self="Hello Dog"\>  
irb(main):004:0\> a.object\_id  
=\> -606004354  
irb(main):005:0\> ap.object\_id  
=\> -606004354  
irb(main):006:0\> ap.\_\_meta\_\_.object\_id  
=\> -606009294

Have fun,  
T.

---

<div class="post-metadata">

**Author:** ![Kevin\_Brown](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@Kevin\_Brown](https://rubytalk.org/u/Kevin_Brown)\
**Post date:** [14 October 2005 11:20 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/22 "2005-10-14T11:20:53Z")

</div>

Biggest place I've hit this is while using DRb and the Qt/Ruby bindings  
together. The bindings make extensive use of method\_missing calls, and those  
just don't work transparently with DRb proxy objects. 🙂

> **···**
>
> On Friday 14 October 2005 05:09, Jeff Wood wrote:
> 
> > Or to be specifically accurate, DRbObjects aren't transparent enough ...  
> > they don't provide you with the list of available functionality  
> > appropriately.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [14 October 2005 15:46 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/23 "2005-10-14T15:46:13Z")

</div>

On the way to work this morning, I even got it executing remote blocks ...

so client code looks like:

require 'roxy'  
obj = Roxy.new( "otherhost", 4242 )  
obj.func( [1, 2, 3] ) { |a| puts a }

... I just have to figure out how I'm going to deal with syntax that is  
multi-layered...

blah.call.call2.call3

with how I have things now, blah.call would be run proxied, but .call2.call3  
would be run locally on the result of the first call.

Anyways, that's about the only issue I have left to work out... I'll post  
soon, better to post early than not at all 😉

j.

> **···**
>
> On 10/14/05, Ara.T.Howard \<Ara.T.Howard@noaa.gov\> wrote:
> 
> > On Fri, 14 Oct 2005, 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 and 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.
> > 
> > sounds neat - now that i understand what you're after. i guess that  
> > approach  
> > would be find so long as one has \_\_some\_\_ method to determine what the  
> > heck  
> > the object 'really' like:
> > 
> > proxy.\_\_drb #=\> the obj  
> > proxy.\_\_drb? #=\> true
> > 
> > but i like the sound of making drb objects as close to local ones at  
> > possible.
> > 
> > look forward to seeing what you come up with.
> > 
> > -a  
> > --
> > 
> > ===============================================================================  
> > \> 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
> > 
> > ===============================================================================
> 
> --  
> "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"
> 
> Jeff Wood

---

<div class="post-metadata">

**Author:** ![Ara.T.Howard6](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Ara.T.Howard6](https://rubytalk.org/u/Ara.T.Howard6)\
**Post date:** [14 October 2005 15:52 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/24 "2005-10-14T15:52:33Z")

</div>

something recursive like

&nbsp;&nbsp;&nbsp;obj.class.instance\_methods.each do |m|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;module\_eval \<\<-code  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def #{ m } \*a, &b  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Roxy::new( send "#{ m }", \*a, &b )  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;code  
&nbsp;&nbsp;&nbsp;end

so, every return value of Roxy must, itself, be a Roxy.

this sounds very nice.

-a

> **···**
>
> On Sat, 15 Oct 2005, Jeff Wood wrote:
> 
> > On the way to work this morning, I even got it executing remote blocks ...
> > 
> > so client code looks like:
> > 
> > require 'roxy'  
> > obj = Roxy.new( "otherhost", 4242 )  
> > obj.func( [1, 2, 3] ) { |a| puts a }
> > 
> > ... I just have to figure out how I'm going to deal with syntax that is  
> > multi-layered...
> > 
> > blah.call.call2.call3
> > 
> > with how I have things now, blah.call would be run proxied, but .call2.call3  
> > would be run locally on the result of the first call.
> > 
> > Anyways, that's about the only issue I have left to work out... I'll post  
> > soon, better to post early than not at all 😉
> 
> # --
> 
> > email :: ara [dot] t [dot] howard [at] noaa [dot] gov  
> > phone :: 303.497.6469  
> > anything that contradicts experience and logic should be abandoned.  
> > -- h.h. the 14th dalai lama
> 
> ===============================================================================

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [14 October 2005 16:01 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/25 "2005-10-14T16:01:47Z")

</div>

Yeah, but I have to tell the server side WHICH object to call the methods on  
... that's what's gumming me up.

I'm glad I've peaked your tastebuds ... It's very close ...

I'll either start it as it's own project or stuff it into nano or mega.

j.

> **···**
>
> On 10/14/05, Ara.T.Howard \<Ara.T.Howard@noaa.gov\> wrote:
> 
> > On Sat, 15 Oct 2005, Jeff Wood wrote:
> > 
> > \> On the way to work this morning, I even got it executing remote blocks  
> > ...  
> > \>  
> > \> so client code looks like:  
> > \>  
> > \> require 'roxy'  
> > \> obj = Roxy.new( "otherhost", 4242 )  
> > \> obj.func( [1, 2, 3] ) { |a| puts a }  
> > \>  
> > \> ... I just have to figure out how I'm going to deal with syntax that is  
> > \> multi-layered...  
> > \>  
> > \> blah.call.call2.call3  
> > \>  
> > \> with how I have things now, blah.call would be run proxied, but  
> > .call2.call3  
> > \> would be run locally on the result of the first call.  
> > \>  
> > \> Anyways, that's about the only issue I have left to work out... I'll  
> > post  
> > \> soon, better to post early than not at all 😉
> > 
> > something recursive like
> > 
> > obj.class.instance\_methods.each do |m|  
> > module\_eval \<\<-code  
> > def #{ m } \*a, &b  
> > Roxy::new( send "#{ m }", \*a, &b )  
> > end  
> > code  
> > end
> > 
> > so, every return value of Roxy must, itself, be a Roxy.
> > 
> > this sounds very nice.
> > 
> > -a  
> > --
> > 
> > ===============================================================================  
> > \> email :: ara [dot] t [dot] howard [at] noaa [dot] gov  
> > \> phone :: 303.497.6469  
> > \> anything that contradicts experience and logic should be abandoned.  
> > \> -- h.h. the 14th dalai lama
> > 
> > ===============================================================================
> 
> --  
> "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"
> 
> Jeff Wood

---

<div class="post-metadata">

**Author:** ![Kirk\_Haines](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Kirk\_Haines](https://rubytalk.org/u/Kirk_Haines)\
**Post date:** [14 October 2005 16:21 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/26 "2005-10-14T16:21:07Z")

</div>

It's own project would be best, IMHO. There's nothing wrong with small  
projects, especially when they stand alone as well as this does.

Thanks,

Kirk Haines

> **···**
>
> On Friday 14 October 2005 10:01 am, Jeff Wood wrote:
> 
> > Yeah, but I have to tell the server side WHICH object to call the methods  
> > on ... that's what's gumming me up.
> > 
> > I'm glad I've peaked your tastebuds ... It's very close ...
> > 
> > I'll either start it as it's own project or stuff it into nano or mega.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [17 October 2005 15:04 UTC](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550/27 "2005-10-17T15:04:02Z")

</div>

I just posted an announcement outside this thread for version 0.1 of  
the project.

Just waiting for rubyforge to approve the project, then I can post source.

j.

> **···**
>
> On 10/14/05, Kirk Haines \<khaines@enigo.com\> wrote:
> 
> > On Friday 14 October 2005 10:01 am, Jeff Wood wrote:  
> > \> Yeah, but I have to tell the server side WHICH object to call the methods  
> > \> on ... that's what's gumming me up.  
> > \>  
> > \> I'm glad I've peaked your tastebuds ... It's very close ...  
> > \>  
> > \> I'll either start it as it's own project or stuff it into nano or mega.
> > 
> > It's own project would be best, IMHO. There's nothing wrong with small  
> > projects, especially when they stand alone as well as this does.
> > 
> > Thanks,
> > 
> > Kirk Haines
> 
> --  
> "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"
> 
> Jeff Wood

[Previous page](https://rubytalk.org/t/challenging-project-need-a-deep-guru-to-provide-enlightenment/21550.md?page=1)
