From 47e1ee2d90161abf92ce14562bf508398fdfa6c9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Aug 2010 13:58:11 -0700 Subject: split out accept() callers to acceptor module Trying to avoid adding singleton methods since it's too easily accessible by the public and not needed by the general public. This also allows us (or just Zbatery) to more easily add support systems without FD_CLOEXEC or fcntl, and also to optimize away a fcntl call for systems that inherit FD_CLOEXEC. --- lib/rainbows/event_machine.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/rainbows/event_machine.rb') diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb index a0b9ca6..2a41015 100644 --- a/lib/rainbows/event_machine.rb +++ b/lib/rainbows/event_machine.rb @@ -169,6 +169,7 @@ module Rainbows end module Server # :nodoc: all + include Rainbows::Acceptor def close detach @@ -177,7 +178,7 @@ module Rainbows def notify_readable return if CUR.size >= MAX - io = Rainbows.accept(@io) or return + io = accept(@io) or return sig = EM.attach_fd(io.fileno, false) CUR[sig] = CL.new(sig, io) end -- cgit v1.2.3-24-ge0c7