Class: InstanceResponseWaiter

Inherits:
OpsDeploy::Waiter show all
Defined in:
lib/ops_deploy/waiter.rb

Overview

A waiter for instance response checks

Instance Attribute Summary

Attributes inherited from OpsDeploy::Waiter

#callback, #data, #end_when

Instance Method Summary collapse

Constructor Details

#initialize(_opsworks, instance, callback = nil) ⇒ InstanceResponseWaiter

Returns a new instance of InstanceResponseWaiter.



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/ops_deploy/waiter.rb', line 65

def initialize(_opsworks, instance, callback = nil)
  super() do
    instance_ip = instance.public_ip || instance.private_ip
    HTTParty.get("http://#{instance_ip}", verify: false)
  end

  @end_when = proc { true }
  @callback = proc do |data, error|
    callback.call(instance, data, error)
  end
end