From 2489368a624cff50a330238cf3c3f16eb0bd743c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 28 Nov 2009 11:26:39 -0800 Subject: common Rainbows.accept method --- lib/rainbows/thread_pool.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/rainbows/thread_pool.rb') diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb index 949db6f..f398828 100644 --- a/lib/rainbows/thread_pool.rb +++ b/lib/rainbows/thread_pool.rb @@ -49,11 +49,8 @@ module Rainbows # problem. On the other hand, a thundering herd may not # even incur as much overhead as an extra Mutex#synchronize ret = IO.select(LISTENERS, nil, nil, 1) and - ret.first.each do |sock| - begin - process_client(sock.accept_nonblock) - rescue Errno::EAGAIN, Errno::ECONNABORTED - end + ret.first.each do |s| + s = Rainbows.accept(s) and process_client(s) end rescue Errno::EINTR rescue Errno::EBADF, TypeError -- cgit v1.2.3-24-ge0c7