Class: EbDeployer::CfEventSource

Inherits:
Object
  • Object
show all
Defined in:
lib/eb_deployer/cf_event_source.rb

Instance Method Summary collapse

Constructor Details

#initialize(stack_name, cf_driver) ⇒ CfEventSource

Returns a new instance of CfEventSource.



3
4
5
6
# File 'lib/eb_deployer/cf_event_source.rb', line 3

def initialize(stack_name, cf_driver)
  @stack_name = stack_name
  @cf_driver = cf_driver
end

Instance Method Details

#fetch_events(from_anchor, &block) ⇒ Object



13
14
15
16
17
# File 'lib/eb_deployer/cf_event_source.rb', line 13

def fetch_events(from_anchor, &block)
  events, next_token = @cf_driver.fetch_events(@stack_name)
  should_continue = yield(events)
  fetch_next(next_token, &block) if next_token && should_continue
end

#get_anchorObject



8
9
10
11
# File 'lib/eb_deployer/cf_event_source.rb', line 8

def get_anchor
  events, _ = @cf_driver.fetch_events(@stack_name)
  events.first
end