about summary refs log tree commit homepage
path: root/lib/rainbows/rev.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-30 18:14:37 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-30 18:14:37 -0700
commitb96822f15c9ede2a0053afeb1a5f43d3df7d7d3d (patch)
tree15be0d666a48ebd0e82e9fd8e0245195d6d9faf9 /lib/rainbows/rev.rb
parentf7189b5074ea99519a2a005c8b0f369bc1fd3a39 (diff)
downloadrainbows-b96822f15c9ede2a0053afeb1a5f43d3df7d7d3d.tar.gz
This module will be reused in upcoming Rev-derived concurrency
models.
Diffstat (limited to 'lib/rainbows/rev.rb')
-rw-r--r--lib/rainbows/rev.rb19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb
index d2bbc49..a1a4e6a 100644
--- a/lib/rainbows/rev.rb
+++ b/lib/rainbows/rev.rb
@@ -1,6 +1,5 @@
 # -*- encoding: binary -*-
-require 'rev'
-Rev::VERSION >= '0.3.0' or abort 'rev >= 0.3.0 is required'
+require 'rainbows/rev/heartbeat'
 require 'rainbows/ev_core'
 
 module Rainbows
@@ -168,22 +167,6 @@ module Rainbows
       end
     end
 
-    # This timer handles the fchmod heartbeat to prevent our master
-    # from killing us.
-    class Heartbeat < ::Rev::TimerWatcher
-      G = Rainbows::G
-
-      def initialize(tmp)
-        @m, @tmp = 0, tmp
-        super(1, true)
-      end
-
-      def on_timer
-        @tmp.chmod(@m = 0 == @m ? 1 : 0)
-        exit if (! G.alive && G.cur <= 0)
-      end
-    end
-
     # runs inside each forked worker, this sits around and waits
     # for connections and doesn't die until the parent dies (or is
     # given a INT, QUIT, or TERM signal)