Class: Ap4r::Mongrel::Ap4rConfigurator

Inherits:
Mongrel::Configurator
  • Object
show all
Defined in:
lib/ap4r/mongrel.rb

Overview

Gather controls AP4R server.

Instance Method Summary collapse

Instance Method Details

#mswin?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ap4r/mongrel.rb', line 25

def mswin?
  RUBY_PLATFORM =~ /mswin/
end

#pid_from_fileObject



35
36
37
38
39
# File 'lib/ap4r/mongrel.rb', line 35

def pid_from_file
  File.open(@pid_file) do |file|
    file.read.to_i
  end
end

#remove_pid_fileObject



29
30
31
32
33
# File 'lib/ap4r/mongrel.rb', line 29

def remove_pid_file
  return unless @pid_file && File.exists?(@pid_file)
  # TODO: slit exists between pid check and delete 2007/04/16 by shino
  File.delete(@pid_file) if pid_from_file == Process.pid
end

#stop(needs_restart = false) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/ap4r/mongrel.rb', line 17

def stop(needs_restart=false)
  ::ReliableMsg::Client.new.instance_eval do
    qm.stop
  end
  super
  join
end