Method: Eye::Process#initialize

Defined in:
lib/eye/process.rb

#initialize(config) ⇒ Process

Returns a new instance of Process.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/eye/process.rb', line 24

def initialize(config)
  raise 'you must supply a pid_file location' unless config[:pid_file]

  @config = prepare_config(config)

  @watchers = {}
  @children = {}
  @triggers = []
  @name = @config[:name]

  @flapping_times = 0

  @states_history = Eye::Process::StatesHistory.new(100)
  @states_history << :unmonitored

  debug "creating with config: #{@config.inspect}"

  add_triggers

  super() # for statemachine
end