Class: DaemonKit::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/daemon_kit/application.rb

Overview

Class responsible for making the daemons run and keep them running.

Class Method Summary collapse

Class Method Details

.run(file) ⇒ Object

Run the file as a daemon

Raises:

  • (DaemonNotFound)


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/daemon_kit/application.rb', line 11

def run( file )
  raise DaemonNotFound.new( file ) unless File.exist?( file )
  
  app_name = DaemonKit.configuration.daemon_name || File.basename( file )
  options = { :backtrace => true, :log_output => true, :app_name => app_name, :dir_mode => :normal, :dir => "log" }

  options[:multiple] = DaemonKit.configuration.multiple
  options[:force_kill_wait] = DaemonKit.configuration.force_kill_wait if DaemonKit.configuration.force_kill_wait

  Daemons.run( file, options )
end

.running!Object

Call this from inside a daemonized process to complete the initialization process



25
26
27
# File 'lib/daemon_kit/application.rb', line 25

def running!
  DaemonKit::Initializer.continue!
end