about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-10-22 02:38:40 +0000
committerEric Wong <normalperson@yhbt.net>2010-10-22 18:37:45 +0000
commit03806d2b44c2d3cee75258ee9e83d671e751baeb (patch)
tree765c10c2dd1910781fe00e1a636d5d2dec0bb56a
parent15631717fce044fbad2f386a7b1c7daf4bdd83d2 (diff)
downloadrainbows-03806d2b44c2d3cee75258ee9e83d671e751baeb.tar.gz
Rainbows::Client takes care of the I/O wait/read-ability
for us already.
-rw-r--r--lib/rainbows/fiber/rev/methods.rb11
-rw-r--r--lib/rainbows/fiber_pool.rb2
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/rainbows/fiber/rev/methods.rb b/lib/rainbows/fiber/rev/methods.rb
index 5f4367e..64108a9 100644
--- a/lib/rainbows/fiber/rev/methods.rb
+++ b/lib/rainbows/fiber/rev/methods.rb
@@ -44,5 +44,12 @@ module Rainbows::Fiber::Rev::Methods
   end
 end
 
-Rainbows::Fiber::IO.__send__(:include, Rainbows::Fiber::Rev::Methods)
-Rainbows::Client.__send__(:include, Rainbows::Fiber::Rev::Methods)
+[
+  Rainbows::Fiber::IO,
+  Rainbows::Client,
+  # the next two trigger autoload, ugh, oh well...
+  Rainbows::Fiber::IO::Socket,
+  Rainbows::Fiber::IO::Pipe
+].each do |klass|
+  klass.__send__(:include, Rainbows::Fiber::Rev::Methods)
+end
diff --git a/lib/rainbows/fiber_pool.rb b/lib/rainbows/fiber_pool.rb
index c0d2ba7..18f43de 100644
--- a/lib/rainbows/fiber_pool.rb
+++ b/lib/rainbows/fiber_pool.rb
@@ -30,7 +30,7 @@ module Rainbows
         schedule do |l|
           fib = pool.shift or break # let another worker process take it
           if io = l.kgio_tryaccept
-            fib.resume(Fiber::IO.new(io, fib))
+            fib.resume(io)
           else
             pool << fib
           end