diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-06-22 02:21:58 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-06-22 02:22:29 +0000 |
commit | 6858c79a49a5d25edb6c06ffd131749eb2f23b2b (patch) | |
tree | c1b5f1dfa46bc340c9833ca56dbfd0187a4e8a1e | |
parent | 51859dfd9b9f11f6cc0af3fc252312b8018a88e2 (diff) | |
download | rainbows-6858c79a49a5d25edb6c06ffd131749eb2f23b2b.tar.gz |
This removes the extra per-process file descriptor and replaces it with Raindrops.
-rw-r--r-- | lib/rainbows.rb | 5 | ||||
-rw-r--r-- | lib/rainbows/base.rb | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb index 64d2d03..ef9e75f 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -65,7 +65,7 @@ module Rainbows attr_accessor :server attr_accessor :cur # may not always be used attr_reader :alive - attr_writer :tick_io + attr_writer :worker attr_writer :forked end @@ -78,7 +78,6 @@ module Rainbows @alive = true @cur = 0 - @tick_mod = 0 @expire = nil @at_quit = [] @@ -87,7 +86,7 @@ module Rainbows end def self.tick - @tick_io.chmod(@tick_mod = 0 == @tick_mod ? 1 : 0) + @worker.tick = Time.now.to_i exit!(2) if @expire && Time.now >= @expire @alive && @server.master_pid == Process.ppid or quit! end diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index c2f7335..e614ccf 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -13,7 +13,7 @@ module Rainbows::Base super(worker) Rainbows::Response.setup(self.class) Rainbows::MaxBody.setup - Rainbows.tick_io = worker.tmp + Rainbows.worker = worker # we're don't use the self-pipe mechanism in the Rainbows! worker # since we don't defer reopening logs |