Module: BlueGreenProcess

Defined in:
lib/blue_green_process.rb,
lib/blue_green_process/config.rb,
lib/blue_green_process/version.rb,
lib/blue_green_process/base_worker.rb,
lib/blue_green_process/master_process.rb,
lib/blue_green_process/worker_process.rb

Defined Under Namespace

Classes: BaseWorker, Config, MasterProcess, WorkerProcess

Constant Summary collapse

PROCESS_STATUS_ACTIVE =
:active
PROCESS_STATUS_INACTIVE =
:inactive
PROCESS_COMMAND_DIE =
"die"
PROCESS_COMMAND_BE_ACTIVE =
"be_active"
PROCESS_COMMAND_BE_INACTIVE =
"work"
PROCESS_COMMAND_WORK =
"be_inactive"
PROCESS_RESPONSE =
"ACK"
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.configObject



37
38
39
# File 'lib/blue_green_process.rb', line 37

def self.config
  @config ||= Config.new
end

.configure {|@config| ... } ⇒ Object

Yields:



31
32
33
34
35
# File 'lib/blue_green_process.rb', line 31

def self.configure
  @config = Config.new
  yield(@config)
  true
end

.debug_log(message) ⇒ Object



25
26
27
28
29
# File 'lib/blue_green_process.rb', line 25

def self.debug_log(message)
  return unless ENV["VERBOSE"]

  puts message
end

.new(worker_instance:, max_work:) ⇒ Object



21
22
23
# File 'lib/blue_green_process.rb', line 21

def self.new(worker_instance:, max_work:)
  BlueGreenProcess::MasterProcess.new(worker_instance: worker_instance, max_work: max_work)
end