From: Eric Hodel Date: 2006-05-18T12:37:06+09:00 Subject: Re: Asynchronous calls in DRb On May 17, 2006, at 8:03 PM, Madan Manoharan wrote: > I am thinking about writing a distributed application in Ruby where > the > application would process all computationally intensive activities > in a > 'dedicated' server. As I was digging thro' drb/drb.rb, I found the > following: [...] > Clearly, DRb is synchronous. Throw away your magnifying glass, you're looking too hard. DRb and Ruby work the same way. In both method calls are synchronous. This does not prevent you from writing a library that works asynchronously. > This would mean that my 'client' cannot hand off the job to the > 'server' and do other things when the 'server' is doing the > computationally intensive job (parallel execution of the 'client' > and 'server' is not possible as the 'client' will be blocked > waiting for reply from the 'server'). Sure it can. I do this all the time without DRb so I can do it just as easily with DRb. Method dispatch works the same with or without DRb. > My questions are: > (1) Is there a way for me to make asynchronous calls in DRb; in > other words, > am I overlooking that functionality? The easiest way is to use threads. The next easiest way is to write an asynchronous library without DRb then modify it to use DRb. > (2) If there is no asynchronous call capabilities in DRb, why was > that not > added when it could have been easily done (not call > client.send_reply and > recv_reply)? Is there a technical reason for it? There's no reason to have asynchronous calls. Asynchronous libraries are implemented above the level of method dispatch. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com