DRb: execute method but dont wait for it to finish

C

Christopher Dancy

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?
 
R

Roger Pack

Christopher said:
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
 
C

Christopher Dancy

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.
 
T

Tony Arcieri

[Note: parts of this message were removed to make it a legal post.]

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

Roger Pack

Christopher said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top