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.
7
8
9
|
# File 'lib/shoryuken/launcher.rb', line 7
def initialize
@managers = create_managers
end
|
Instance Method Details
#healthy? ⇒ Boolean
44
45
46
47
48
49
|
# File 'lib/shoryuken/launcher.rb', line 44
def healthy?
Shoryuken.groups.keys.all? do |group|
manager = @managers.find { |m| m.group == group }
manager && manager.running?
end
end
|
#start ⇒ Object
11
12
13
14
15
16
|
# File 'lib/shoryuken/launcher.rb', line 11
def start
logger.info { 'Starting' }
start_callback
start_managers
end
|
#stop ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/shoryuken/launcher.rb', line 30
def stop
fire_event(:quiet, true)
initiate_stop
stop_new_dispatching
await_dispatching_in_progress
executor.shutdown
executor.wait_for_termination
fire_event(:stopped)
end
|
#stop! ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/shoryuken/launcher.rb', line 18
def stop!
initiate_stop
stop_new_dispatching
executor.shutdown
executor.kill unless executor.wait_for_termination(Shoryuken.options[:timeout])
fire_event(:stopped)
end
|