about summary refs log tree commit homepage
path: root/lib/rainbows/fiber/rev/kato.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-27 13:10:57 -0800
committerEric Wong <normalperson@yhbt.net>2010-12-27 21:11:31 +0000
commit728496a31f34234b46d7025a23933aa06dd824f5 (patch)
tree3853385379df54b0f1d2d3927e2fa5817cbe2bf2 /lib/rainbows/fiber/rev/kato.rb
parent0766c1eb631190ee514a90e4d20a941f0a310054 (diff)
downloadrainbows-728496a31f34234b46d7025a23933aa06dd824f5.tar.gz
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.
Diffstat (limited to 'lib/rainbows/fiber/rev/kato.rb')
-rw-r--r--lib/rainbows/fiber/rev/kato.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/rainbows/fiber/rev/kato.rb b/lib/rainbows/fiber/rev/kato.rb
deleted file mode 100644
index 056b6ef..0000000
--- a/lib/rainbows/fiber/rev/kato.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- encoding: binary -*-
-# :enddoc:
-# keep-alive timeout class
-class Rainbows::Fiber::Rev::Kato < Rev::TimerWatcher
-  def initialize
-    @watch = []
-    super(1, true)
-  end
-
-  def <<(fiber)
-    @watch << fiber
-    enable unless enabled?
-  end
-
-  def on_timer
-    @watch.uniq!
-    while f = @watch.shift
-      f.resume if f.alive?
-    end
-    disable
-  end
-end