Parent

Methods

Class/Module Index [+]

Quicksearch

Bunny::SystemTimer

Used for Ruby before 1.9

Public Class Methods

timeout(seconds, exception) click to toggle source

Executes a block of code, raising if the execution does not finish in the alloted period of time, in seconds.

# File lib/bunny/system_timer.rb, line 9
def self.timeout(seconds, exception)
  if seconds
    ::SystemTimer.timeout_after(seconds, exception) do
      yield
    end
  else
    yield
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.