about summary refs log tree commit homepage
path: root/lib/rainbows.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.rb
parent6443cc4b87e3ba71ad661d795c3856f95a058a24 (diff)
downloadrainbows-2489368a624cff50a330238cf3c3f16eb0bd743c.tar.gz
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb6
1 files changed, 6 insertions, 0 deletions
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