Module: SupervisorCommandsDiagnostics

Defined in:
lib/onapp/engine/utils/diagnostics.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) run



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/onapp/engine/utils/diagnostics.rb', line 21

def self.run
  supervisors = Daemon.supervision.handlers.all.map(&:handler)

  supervisors.each do |s|
    s.messages_manager.on_command do |cmd|
      puts "#{s.name.inspect} -> #{cmd.inspect}"
    end
    s.messages_manager.subscribe
  end

  ask "Listening supervision commands (Press any key to break)"

  supervisors.each do |s|
    s.messages_manager.on_command do |cmd|
    end
  end

  puts "Break"
end