Class: Citrus::ConsoleModules::MonitorWatcher

Inherits:
ConsoleModule show all
Defined in:
lib/citrus/modules/monitor_watcher.rb

Overview

MaterWatcher

Instance Attribute Summary

Attributes inherited from ConsoleModule

#delay, #interval, #type

Instance Method Summary collapse

Methods inherited from ConsoleModule

inherited

Constructor Details

#initialize(args = {}, console_service) ⇒ MonitorWatcher

Initialize the module

Parameters:

  • args (Hash) (defaults to: {})
  • console_service (Object)


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

Parameters:

  • agent (Object)
  • msg (Hash)


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