is timeout.rb fixed in 1.9.2?

Discussion in 'Ruby' started by bill walton, Sep 28, 2012.

  1. bill walton

    bill walton Guest

    bill walton, Sep 28, 2012
    1. Advertisements

  2. You can check for yourself:

    Note, while looking into this I opened a few bugs today:


    My solution timeout_1 could be used but it will keep the background
    thread running. You could change it like so:

    def timeout_5(timeout, &code)
    raise ArgumentError, "Invalid timeout: %p" % [timeout] unless timeout > 0
    raise ArgumentError, "No code to execute" if code.nil?

    worker =

    if worker.join(timeout)
    worker.kill rescue nil
    # worker.raise Exception, "Stop"

    Kind regards

    Robert Klemme, Sep 29, 2012
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.