Sha256: 4c0c82bd2838a50c4644770f013470861a0e3c7d8c4e84ea5c84caa114ad3019
Contents?: true
Size: 407 Bytes
Versions: 52
Compression:
Stored size: 407 Bytes
Contents
module Fog def self.wait_for(timeout=Fog.timeout, interval=1, &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
52 entries across 52 versions & 7 rubygems