Class: Kamal::Cli::Healthcheck::Barrier

Inherits:
Object
  • Object
show all
Defined in:
lib/kamal/cli/healthcheck/barrier.rb

Instance Method Summary collapse

Constructor Details

#initializeBarrier

Returns a new instance of Barrier.



4
5
6
# File 'lib/kamal/cli/healthcheck/barrier.rb', line 4

def initialize
  @ivar = Concurrent::IVar.new
end

Instance Method Details

#closeObject



8
9
10
# File 'lib/kamal/cli/healthcheck/barrier.rb', line 8

def close
  set(false)
end

#openObject



12
13
14
# File 'lib/kamal/cli/healthcheck/barrier.rb', line 12

def open
  set(true)
end

#waitObject



16
17
18
19
20
# File 'lib/kamal/cli/healthcheck/barrier.rb', line 16

def wait
  unless opened?
    raise Kamal::Cli::Healthcheck::Error.new("Halted at barrier")
  end
end