about summary refs log tree commit homepage
path: root/lib/rainbows/fiber_pool.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-28 11:26:39 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-28 11:26:39 -0800
commit2489368a624cff50a330238cf3c3f16eb0bd743c (patch)
tree782d060210a50cbf96ee3df11781f76a96166298 /lib/rainbows/fiber_pool.rb
parent6443cc4b87e3ba71ad661d795c3856f95a058a24 (diff)
downloadrainbows-2489368a624cff50a330238cf3c3f16eb0bd743c.tar.gz
Diffstat (limited to 'lib/rainbows/fiber_pool.rb')
-rw-r--r--lib/rainbows/fiber_pool.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/rainbows/fiber_pool.rb b/lib/rainbows/fiber_pool.rb
index 25f086e..2a1c5f7 100644
--- a/lib/rainbows/fiber_pool.rb
+++ b/lib/rainbows/fiber_pool.rb
@@ -29,13 +29,11 @@ module Rainbows
       begin
         schedule do |l|
           fib = pool.shift or break # let another worker process take it
-          io = begin
-            l.accept_nonblock
-          rescue Errno::EAGAIN, Errno::ECONNABORTED
+          if io = Rainbows.accept(l)
+            fib.resume(Fiber::IO.new(io, fib))
+          else
             pool << fib
-            next
           end
-          fib.resume(Fiber::IO.new(io, fib))
         end
       rescue => e
         Error.listen_loop(e)