Class: Ductwork::Processes::Launcher

Inherits:
Object
  • Object
show all
Defined in:
lib/ductwork/processes/launcher.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLauncher

Returns a new instance of Launcher.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ductwork/processes/launcher.rb', line 10

def initialize
  @pipelines = Ductwork.configuration.pipelines
  @runner_klass = if Ductwork.configuration.forking == "default"
                    case Ductwork.configuration.role
                    when "all"
                      process_supervisor_runner
                    when "advancer"
                      pipeline_advancer_runner
                    when "worker"
                      job_worker_runner
                    end
                  else
                    thread_supervisor_runner
                  end
end

Class Method Details

.start_processes!Object



6
7
8
# File 'lib/ductwork/processes/launcher.rb', line 6

def self.start_processes!
  new.start_processes!
end

Instance Method Details

#start_processes!Object



26
27
28
29
30
# File 'lib/ductwork/processes/launcher.rb', line 26

def start_processes!
  runner_klass
    .new(*pipelines)
    .run
end