Class: AwsAsCode::StackStateSemaphore
- Inherits:
-
Object
- Object
- AwsAsCode::StackStateSemaphore
- Includes:
- Term::ANSIColor
- Defined in:
- lib/aws_as_code/stack_state_semaphore.rb
Instance Method Summary collapse
-
#initialize(logger:) ⇒ StackStateSemaphore
constructor
A new instance of StackStateSemaphore.
- #wait(stack) ⇒ Object
- #wait_for_stack_availability(stack) ⇒ Object
Constructor Details
#initialize(logger:) ⇒ StackStateSemaphore
Returns a new instance of StackStateSemaphore.
9 10 11 |
# File 'lib/aws_as_code/stack_state_semaphore.rb', line 9 def initialize(logger:) @logger = logger end |
Instance Method Details
#wait(stack) ⇒ Object
13 14 15 16 17 |
# File 'lib/aws_as_code/stack_state_semaphore.rb', line 13 def wait(stack) wait_for_stack_availability stack yield wait_for_stack_availability stack end |
#wait_for_stack_availability(stack) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/aws_as_code/stack_state_semaphore.rb', line 19 def wait_for_stack_availability(stack) # Note that stack can have old state cached, hence explicit # .reload here stack.reload.wait_until(max_attempts: 360, delay: 10) do |s| if in_progress? s log_waiting s false else log_proceeding s true end end end |