Class TimeoutX
In: lib/timeoutx.rb
Parent: Object

Methods

Included Modules

Singleton

Classes and Modules

Class TimeoutX::Error

Constants

VERSION = Version::STRING

Attributes

interval  [RW] 
table  [R] 
thread  [R] 

Public Class methods

Replaces Timeout.timeout into TimeoutX.timeout.

[Source]

    # File lib/timeoutx.rb, line 67
67:   def self.replace_timeout
68:     require "timeout"
69:     def Timeout.timeout(sec, exception=Timeout::Error) #:nodoc:
70:       TimeoutX.timeout(sec, exception)
71:     end
72:   end

Sets the interval second of intrenal countdown loop.

[Source]

    # File lib/timeoutx.rb, line 32
32:   def self.set_interval(sec)
33:     instance.interval = sec
34:   end

Same as Timeout#timeout.

[Source]

    # File lib/timeoutx.rb, line 55
55:   def self.timeout(sec, exception=TimeoutX::Error)
56:     append(Thread.current, sec, exception)
57:     begin
58:       yield if block_given?
59:     rescue => ex
60:       raise(ex)
61:     ensure
62:       delete(Thread.current)
63:     end
64:   end

[Validate]