Sha256: 0fa0c7215afaab22b6e89c2dcd7f604e37e86a75e39a53418ad177bb1bab18c9
Contents?: true
Size: 418 Bytes
Versions: 19
Compression:
Stored size: 418 Bytes
Contents
module Fog def self.wait_for(timeout=Fog.timeout, interval=Fog.interval, &block) duration = 0 start = Time.now until yield || duration > timeout sleep(interval.to_f) duration = Time.now - start end if duration > timeout raise Errors::TimeoutError.new("The specified wait_for timeout (#{timeout} seconds) was exceeded") else { :duration => duration } end end end
Version data entries
19 entries across 19 versions & 3 rubygems