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

Version Path
timeouter-0.1.3.38794 lib/timeouter.rb
timeouter-0.1.2.38793 lib/timeouter.rb
timeouter-0.1.2.16873 lib/timeouter.rb
timeouter-0.1.2.16549 lib/timeouter.rb
timeouter-0.1.2.16546 lib/timeouter.rb
timeouter-0.1.2.16535 lib/timeouter.rb
timeouter-0.1.2.16523 lib/timeouter.rb
timeouter-0.1.2.16522 lib/timeouter.rb
timeouter-0.1.2.16521 lib/timeouter.rb
timeouter-0.1.2.16511 lib/timeouter.rb
timeouter-0.1.2.16510 lib/timeouter.rb
timeouter-0.1.2.16508 lib/timeouter.rb
timeouter-0.1.1.16497 lib/timeouter.rb
timeouter-0.1.1.16489 lib/timeouter.rb
timeouter-0.1.1 lib/timeouter.rb