Class: Shoryuken::Launcher
- Inherits:
-
Object
- Object
- Shoryuken::Launcher
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
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
#healthy? ⇒ Boolean
38
39
40
41
42
43
|
# File 'lib/shoryuken/launcher.rb', line 38
def healthy?
Shoryuken.groups.keys.all? do |group|
manager = @managers.find { |m| m.group == group }
manager && manager.running?
end
end
|
#start ⇒ Object
9
10
11
12
13
14
|
# File 'lib/shoryuken/launcher.rb', line 9
def start
logger.info { 'Starting' }
start_callback
start_managers
end
|
#stop ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/shoryuken/launcher.rb', line 26
def stop
fire_event(:quiet, true)
initiate_stop
stop_new_dispatching
await_dispatching_in_progress
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
|