Sha256: 9b656cbde3d019acf6a6c78db37158ecd7aa9a60cedc74dabf9f7131c93228fd

Contents?: true

Size: 281 Bytes

Versions: 14

Compression:

Stored size: 281 Bytes

Contents

module ProconBypassMan
  class SafeTimeout
    class Timeout < StandardError; end

    # 5秒後がタイムアウト
    def initialize(timeout: Time.now + 5)
      @timeout = timeout
    end

    def throw_if_timeout!
      raise Timeout if @timeout < Time.now
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
procon_bypass_man-0.1.22 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.21 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.20.2 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.20.1 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.20 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.19.1 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.19 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.18 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.17 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.16.1 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.16 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.15 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.14 lib/procon_bypass_man/support/safe_timeout.rb
procon_bypass_man-0.1.13 lib/procon_bypass_man/support/safe_timeout.rb