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/fiber/rev.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/rainbows/fiber') diff --git a/lib/rainbows/fiber/rev.rb b/lib/rainbows/fiber/rev.rb index c23d844..632b562 100644 --- a/lib/rainbows/fiber/rev.rb +++ b/lib/rainbows/fiber/rev.rb @@ -54,6 +54,7 @@ module Rainbows::Fiber include Rainbows include Rainbows::Const include Rainbows::Response + include Rainbows::Acceptor FIO = Rainbows::Fiber::IO def to_io @@ -72,7 +73,7 @@ module Rainbows::Fiber def on_readable return if G.cur >= MAX - c = Rainbows.accept(@io) and ::Fiber.new { process(c) }.resume + c = accept(@io) and ::Fiber.new { process(c) }.resume end def process(io) -- cgit v1.2.3-24-ge0c7