Class: Shoryuken::Launcher

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/shoryuken/launcher.rb

Instance Method Summary collapse

Methods included from Util

#elapsed, #fire_event, #logger, #unparse_queues, #worker_name

Constructor Details

#initializeLauncher

Returns a new instance of Launcher.


5
6
7
# File 'lib/shoryuken/launcher.rb', line 5

def initialize
  @managers = create_managers
end

Instance Method Details

#startObject


9
10
11
12
13
14
# File 'lib/shoryuken/launcher.rb', line 9

def start
  logger.info { 'Starting' }

  start_callback
  start_managers
end

#stopObject


26
27
28
29
30
31
32
33
# File 'lib/shoryuken/launcher.rb', line 26

def stop
  fire_event(:quiet, true)

  initiate_stop

  executor.shutdown
  executor.wait_for_termination
end

#stop!Object


16
17
18
19
20
21
22
23
24
# File 'lib/shoryuken/launcher.rb', line 16

def stop!
  initiate_stop

  executor.shutdown

  return if executor.wait_for_termination(Shoryuken.options[:timeout])

  executor.kill
end