Timeout

Discussion in 'Ruby' started by eastcoastcoder@gmail.com, Feb 7, 2006.

  1. Guest

    Does Ruby's Timeout know about time spent outside of Ruby's
    interpreter?

    For instance, will it call Timeout in the model of long syscalls (ie,
    blocking io which is taking too long).

    If not, what is the best way to tell Ruby to abort a syscall after x
    seconds. (I couldn't find a way of setting an alarm handler).
     
    , Feb 7, 2006
    #1
    1. Advertising

  2. Eric Hodel Guest

    On Feb 6, 2006, at 11:18 PM, wrote:

    > Does Ruby's Timeout know about time spent outside of Ruby's
    > interpreter?


    Did you try it? It is really, really easy, especially with irb.

    > For instance, will it call Timeout in the model of long syscalls (ie,
    > blocking io which is taking too long).


    require 'timeout'
    require 'socket'

    s = TCPSocket.new 'localhost', 80
    Timeout.timeout 5 do s.read end

    --
    Eric Hodel - - http://segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
     
    Eric Hodel, Feb 7, 2006
    #2
    1. Advertising

  3. Guest

    Thanks for the help.

    For anyone who's reading this's reference, the answer is that Timeout
    does timeout in the middle of syscalls.
     
    , Feb 7, 2006
    #3
    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. Bob Johnson
    Replies:
    0
    Views:
    3,777
    Bob Johnson
    Aug 7, 2003
  2. Do
    Replies:
    2
    Views:
    6,383
  3. Guoqi Zheng
    Replies:
    4
    Views:
    13,036
    Guoqi Zheng
    Jun 3, 2004
  4. Just D

    IIS timeout, IE timeout or what?

    Just D, Jun 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,534
    Just D
    Jun 21, 2004
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,293
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page