Class: Citrus::ConsoleModules::MonitorWatcher
- Inherits:
-
ConsoleModule
- Object
- ConsoleModule
- Citrus::ConsoleModules::MonitorWatcher
- Defined in:
- lib/citrus/modules/monitor_watcher.rb
Overview
MaterWatcher
Instance Attribute Summary
Attributes inherited from ConsoleModule
Instance Method Summary collapse
-
#initialize(args = {}, console_service) ⇒ MonitorWatcher
constructor
Initialize the module.
-
#monitor_handler(agent, msg, &block) ⇒ Object
Monitor handler.
-
#start(&block) ⇒ Object
Start the module.
Methods inherited from ConsoleModule
Constructor Details
#initialize(args = {}, console_service) ⇒ MonitorWatcher
Initialize the module
23 24 25 26 27 |
# File 'lib/citrus/modules/monitor_watcher.rb', line 23 def initialize args={}, console_service @app = args[:app] @service = console_service @server_id = @app.server_id end |
Instance Method Details
#monitor_handler(agent, msg, &block) ⇒ Object
Monitor handler
38 39 40 41 42 43 44 45 |
# File 'lib/citrus/modules/monitor_watcher.rb', line 38 def monitor_handler agent, msg, &block return if !msg || !msg[:action] case msg[:action] when 'add_server' handle_add_server agent, msg else end end |
#start(&block) ⇒ Object
Start the module
30 31 32 |
# File 'lib/citrus/modules/monitor_watcher.rb', line 30 def start &block subscribe_request &block end |