Sha256: 6d74b7005cd65bf534814faa30efd664be7db0d81616c5d70cfdb8b35029b193
Contents?: true
Size: 662 Bytes
Versions: 15
Compression:
Stored size: 662 Bytes
Contents
require 'timeouter/timer' module Timeouter TimeoutError = Timeout::Error class << self def run(timeout = 0, eclass: Timeouter::TimeoutError, message: 'execution expired') yield(Timeouter::Timer.new(timeout, eclass: eclass, message: message)) end def loop(timeout = 0, eclass: Timeouter::TimeoutError, message: 'execution expired', &block) Timeouter::Timer.new(timeout, eclass: eclass, message: message).loop(&block) end def loop!(timeout = 0, eclass: Timeouter::TimeoutError, message: 'execution expired', &block) Timeouter::Timer.new(timeout, eclass: eclass, message: message).loop!(&block) end end end
Version data entries
15 entries across 15 versions & 1 rubygems