From 728496a31f34234b46d7025a23933aa06dd824f5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Dec 2010 13:10:57 -0800 Subject: coolio_fiber_spawn: decrease CPU usage for keepalive Blindly resuming fibers every second is a waste of cycles, we can use the ZZ hash in regular FiberSpawn to resume expired fibers on an as-needed basis. While we're at it, merge the keepalive-timeout class into the heartbeat, there's no reason to have separate timers and classes here. --- lib/rainbows/rev_fiber_spawn.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/rainbows/rev_fiber_spawn.rb') diff --git a/lib/rainbows/rev_fiber_spawn.rb b/lib/rainbows/rev_fiber_spawn.rb index 4338703..8d0d625 100644 --- a/lib/rainbows/rev_fiber_spawn.rb +++ b/lib/rainbows/rev_fiber_spawn.rb @@ -22,8 +22,6 @@ module Rainbows::RevFiberSpawn Rainbows::Fiber::Base.setup(Server, nil) Server.const_set(:APP, G.server.app) Heartbeat.new(1, true).attach(Rev::Loop.default) - kato = Kato.new.attach(Rev::Loop.default) - Rainbows::Fiber::Rev::Methods.const_set(:KATO, kato) LISTENERS.map! { |s| Server.new(s).attach(Rev::Loop.default) } Rev::Loop.default.run end -- cgit v1.2.3-24-ge0c7