Sha256: 31066c26915a251d413422a16a974ea1def28ceb2ae9d338a70787ca9da87d61
Contents?: true
Size: 485 Bytes
Versions: 28
Compression:
Stored size: 485 Bytes
Contents
# -*- encoding: utf-8; mode: ruby -*- require "system_timer" module GorgonBunny # Used for Ruby before 1.9 class SystemTimer # Executes a block of code, raising if the execution does not finish # in the alloted period of time, in seconds. def self.timeout(seconds, exception = nil) if seconds ::SystemTimer.timeout_after(seconds, exception) do yield end else yield end end end # SystemTimer end # GorgonBunny
Version data entries
28 entries across 28 versions & 1 rubygems