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.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/rainbows.rb') diff --git a/lib/rainbows.rb b/lib/rainbows.rb index 8a41586..a252ba6 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -86,6 +86,12 @@ module Rainbows end autoload :Fiber, 'rainbows/fiber' # core class + # returns nil if accept fails + def self.accept(sock) + sock.accept_nonblock + rescue Errno::EAGAIN, Errno::ECONNABORTED + end + end # inject the Rainbows! method into Unicorn::Configurator -- cgit v1.2.3-24-ge0c7