Sha256: cda862853a8b7a731ae4f0422e7979367ee31240f791bc41c2bb38ff5ae9a3ec
Contents?: true
Size: 467 Bytes
Versions: 28
Compression:
Stored size: 467 Bytes
Contents
# -*- encoding: utf-8; mode: ruby -*- require "system_timer" module Bunny # 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) if seconds ::SystemTimer.timeout_after(seconds, exception) do yield end else yield end end end # SystemTimer end # Bunny
Version data entries
28 entries across 28 versions & 1 rubygems