DRb: execute method but dont wait for it to finish

Basically I want to execute a method on a drb service but not wait for
it to return … The DRb service is undumped … basically just telling
it to do something. Is there any easy way to do this?

Christopher Dancy wrote:

Basically I want to execute a method on a drb service but not wait for
it to return … The DRb service is undumped … basically just telling
it to do something. Is there any easy way to do this?

Run it in a sub thread you don’t join on?
-rp

Run it in a sub thread you don’t join on?
-rp

That’s actually what I’m doing now and then killing off the thread after
a few seconds so as not to waste the precious resources of my 1 single
ruby process. I was hoping there was a more elegant solution or maybe
just a “right” way to do it.

DRb is inherently synchronous, so unfortunately not. Depending on your
problem, you might look at using an asynchronous system such as
DelayedJob
or Resque

On Fri, Apr 16, 2010 at 7:34 AM, Christopher Dancy
<[email protected]

Christopher Dancy wrote:

Run it in a sub thread you don’t join on?
-rp

That’s actually what I’m doing now and then killing off the thread after
a few seconds so as not to waste the precious resources of my 1 single
ruby process. I was hoping there was a more elegant solution or maybe
just a “right” way to do it.

I don’t think there is (though you could commit a patch to trunk that
would allow for it, perhaps).

http://emdrb.rubyforge.org

Mentions it has “synchronous and asynchronous modes”
Though I’ve never tried it I’ve run into it a few times.
GL.
-rp