Module: SystemTimer

Module | SystemTimer
In: | lib/system_timer/concurrent_timer_pool.rb lib/system_timer/thread_timer.rb lib/system_timer.rb lib/system_timer_stub.rb

Timer based on underlying `ITIMER_REAL` system timer. It is a solution to Ruby processes which hang beyond the time limit when accessing external resources. This is useful when timeout.rb, which relies on green threads, does not work consistently.

For more information and background check out:

- ph7spot.com/articles/system_timer
- davidvollbracht.com/2008/6/2/30-days-of-teach-day-1-systemtimer

## Usage

      require 'systemtimer'

      SystemTimer.timeout_after(5) do

        # Something that should be interrupted if it takes too much time...
        # ... even if blocked on a system call!

      end

### Methods

debug timeout_after timeout_after

### Classes and Modules

Class SystemTimer::ConcurrentTimerPool
Class SystemTimer::ThreadTimer

### External Aliases

timeout_after | -> | timeout
| Backward compatibility with timeout.rb
timeout_after | -> | timeout
| Backward compatibility with timeout.rb

### Attributes

timer_pool | [R] |

### Public Class methods

timeout_after(seconds) {|| ...}

Executes the method‘s block. If the block execution terminates before `seconds` seconds has passed, it returns true. If not, it terminates the execution and raises a +Timeout::Error+.

timeout_after(seconds) {|| ...}

### Protected Class methods

debug(message)

[Validate]