Sha256: fa6f35b49aeab6fa0d793df936b5195588614324629bfb7f4eec6b5bbb9cd0e1
Contents?: true
Size: 447 Bytes
Versions: 107
Compression:
Stored size: 447 Bytes
Contents
module Scrivito class CmsRestApi class RequestTimer MIN_REQUEST_TIME = 0.005 def initialize(max_duration) @finish_before = Time.now + max_duration end def finished? remaining_time <= MIN_REQUEST_TIME end def remaining_time [finish_before - Time.now, 0].max end def cover?(point_in_time) point_in_time <= finish_before end private attr_reader :finish_before end end end
Version data entries
107 entries across 107 versions & 1 rubygems