DRb: execute method but dont wait for it to finish

Discussion in 'Ruby' started by Christopher Dancy, Apr 15, 2010.

  1. 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?
    --
    Posted via http://www.ruby-forum.com/.
    Christopher Dancy, Apr 15, 2010
    #1
    1. Advertising

  2. Christopher Dancy

    Roger Pack Guest

    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
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Apr 15, 2010
    #2
    1. Advertising

  3. >
    > 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.
    --
    Posted via http://www.ruby-forum.com/.
    Christopher Dancy, Apr 16, 2010
    #3
  4. Christopher Dancy

    Tony Arcieri Guest

    [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

    On Fri, Apr 16, 2010 at 7:34 AM, 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.
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >



    --
    Tony Arcieri
    Medioh! A Kudelski Brand
    Tony Arcieri, Apr 16, 2010
    #4
  5. Christopher Dancy

    Roger Pack Guest

    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
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Apr 16, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mike
    Replies:
    6
    Views:
    843
    John C. Bollinger
    Aug 9, 2004
  2. Gary J
    Replies:
    19
    Views:
    39,239
    Chris Uppal
    Aug 31, 2004
  3. Replies:
    8
    Views:
    4,528
  4. Uros
    Replies:
    2
    Views:
    310
  5. Zhidian Du
    Replies:
    2
    Views:
    98
    David Efflandt
    Feb 21, 2004
Loading...

Share This Page