Class: Flamingo::Daemon::DispatcherProcess

Inherits:
ChildProcess show all
Defined in:
lib/flamingo/daemon/dispatcher_process.rb

Instance Attribute Summary

Attributes inherited from ChildProcess

#pid

Instance Method Summary collapse

Methods inherited from ChildProcess

#kill, #running?, #start

Methods included from TrapKeeper

trap

Instance Method Details

#register_signal_handlersObject



17
18
19
20
# File 'lib/flamingo/daemon/dispatcher_process.rb', line 17

def register_signal_handlers
  trap("INT")  { stop }
  trap("TERM") { stop }
end

#runObject



5
6
7
8
9
10
11
# File 'lib/flamingo/daemon/dispatcher_process.rb', line 5

def run
  register_signal_handlers
  $0 = "flamingod-dispatcher"
  @dispatcher = Flamingo::Dispatcher.new
  Flamingo.logger.info "Starting dispatcher on pid=#{Process.pid} under pid=#{Process.ppid}"
  @dispatcher.run
end

#stopObject



13
14
15
# File 'lib/flamingo/daemon/dispatcher_process.rb', line 13

def stop
  @dispatcher.stop
end