Class: AwsHelpers::ElasticBeanstalk::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_helpers/elastic_beanstalk/events.rb

Instance Method Summary collapse

Constructor Details

#initialize(elastic_beanstalk_client) ⇒ Events

Returns a new instance of Events


5
6
7
# File 'lib/aws_helpers/elastic_beanstalk/events.rb', line 5

def initialize(elastic_beanstalk_client)
  @elastic_beanstalk_client = elastic_beanstalk_client
end

Instance Method Details

#pool(start_time, application, environment) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/aws_helpers/elastic_beanstalk/events.rb', line 9

def pool(start_time, application, environment)
  puts "Pooling events from #{start_time} for #{application}, #{environment}"
  loop do
    response = describe_version_events(start_time, application, environment)
    has_error = error?(response)
    has_success = success?(response)
    output_events(response) if has_success || has_error
    fail if has_error
    break if has_success
    sleep 10
  end
end