Sha256: 9071bef88ecf3854fc02ff90da3a8a71ecd5fb95ff476fc960e0dba454501b9a

Contents?: true

Size: 744 Bytes

Versions: 12

Compression:

Stored size: 744 Bytes

Contents

module EbDeployer
  class CfEventSource
    def initialize(stack_name, cf_driver)
      @stack_name = stack_name
      @cf_driver = cf_driver
    end

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

    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

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

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
man_eb_deployer-0.8.0 lib/eb_deployer/cf_event_source.rb
eb_deployer_updated-0.8.1 lib/eb_deployer/cf_event_source.rb
eb_deployer_updated-0.8.0 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.7.0 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.6 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.5 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.4 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.3 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.2 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.1 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.0 lib/eb_deployer/cf_event_source.rb
eb_deployer-0.6.0.beta6 lib/eb_deployer/cf_event_source.rb