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

Version Path
cifrado-0.2.1 vendor/fog/lib/fog/core/wait_for.rb
cifrado-0.2.0 vendor/fog/lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/core/wait_for.rb
gapinc-fog-1.12.1.2.1 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/core/wait_for.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/core/wait_for.rb