Class: Salemove::ProcessHandler::ProcessMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/salemove/process_handler/process_monitor.rb

Direct Known Subclasses

CompositeProcessMonitor, CronProcessMonitor

Instance Method Summary collapse

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/salemove/process_handler/process_monitor.rb', line 21

def alive?
  @state != :stopped
end

#running?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/salemove/process_handler/process_monitor.rb', line 17

def running?
  @state == :running
end

#shutdownObject



13
14
15
# File 'lib/salemove/process_handler/process_monitor.rb', line 13

def shutdown
  @state = :stopped
end

#startObject



4
5
6
7
# File 'lib/salemove/process_handler/process_monitor.rb', line 4

def start
  init_signal_handlers
  @state = :running
end

#stopObject



9
10
11
# File 'lib/salemove/process_handler/process_monitor.rb', line 9

def stop
  @state = :stopping if alive?
end