diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-09-28 17:40:01 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-09-28 17:40:01 -0700 |
commit | ad821f70a2488a91f2be1ac53cb2e64f50743989 (patch) | |
tree | 6db4d334106360305ba3b66b643e8694f232fa10 /lib/rainbows/rev/core.rb | |
parent | 11c75ec06ce72cea0c760161dc01a196500aa293 (diff) | |
download | rainbows-ad821f70a2488a91f2be1ac53cb2e64f50743989.tar.gz |
It removes the burden of byte slicing and setting file descriptor flags. In some cases, we can remove unnecessary peeraddr calls, too.
Diffstat (limited to 'lib/rainbows/rev/core.rb')
-rw-r--r-- | lib/rainbows/rev/core.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rainbows/rev/core.rb b/lib/rainbows/rev/core.rb index aecd5e8..2273b24 100644 --- a/lib/rainbows/rev/core.rb +++ b/lib/rainbows/rev/core.rb @@ -7,12 +7,11 @@ require 'rainbows/rev/heartbeat' module Rainbows module Rev class Server < ::Rev::IO - include Rainbows::Acceptor # CL and MAX will be defined in the corresponding worker loop def on_readable return if CONN.size >= MAX - io = accept(@_io) and CL.new(io).attach(LOOP) + io = @_io.kgio_tryaccept and CL.new(io).attach(LOOP) end end # class Server |