Sha256: b41648f0b6dba10e93ca6224ae3ceb084bed4bd1a9b90bdf2363144f929e7fa4
Contents?: true
Size: 490 Bytes
Versions: 38
Compression:
Stored size: 490 Bytes
Contents
module Fog def self.wait_for(timeout = Fog.timeout, interval = Fog.interval, &_block) duration = 0 start = Time.now retries = 0 loop do break if yield if duration > timeout raise Errors::TimeoutError, "The specified wait_for timeout (#{timeout} seconds) was exceeded" end sleep(interval.respond_to?(:call) ? interval.call(retries += 1).to_f : interval.to_f) duration = Time.now - start end { :duration => duration } end end
Version data entries
38 entries across 35 versions & 3 rubygems