webrick daemon : Daemon « Threads « Ruby






webrick daemon


require 'tempfile'
require 'webrick'

WEBrick::Daemon.start do 
  log = Tempfile.new('daemon.log')
  loop do
    log.puts "I'm a daemon, doin' daemon things."
    log.flush
    sleep 5
  end
end

 








Related examples in the same category

1.Forking a Daemon Process on Unix.rb
2.daemon spawn