Sha256: e98bdf39b3f2e3c326833e03f26602f12ff11c2225f647c686d06489ad042b03
Contents?: true
Size: 369 Bytes
Versions: 20
Compression:
Stored size: 369 Bytes
Contents
module ProconBypassMan class SafeTimeout class Timeout < StandardError; end # 5秒後がタイムアウト def initialize(timeout: Time.now + 5) @timeout = timeout end # @raise [Timeout] def throw_if_timeout! raise Timeout if timeout? end # @return [Boolean] def timeout? @timeout < Time.now end end end
Version data entries
20 entries across 20 versions & 1 rubygems