Created
June 21, 2012 23:05
-
-
Save tomekr/2969149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' # if you use RubyGems | |
require 'daemons' | |
task1 = Daemons.call(:multiple => true) do | |
loop { | |
File.open("/tmp/daemon_test.log", "w") {|f| f.write(Time.now.to_s + "\n")} | |
sleep 5 | |
} | |
end | |
puts task1.pid.pid | |
puts task1.pid | |
#ruby test.rb | |
#nil | |
##<Daemons::PidMem:0x10a3d6818> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment