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/fiber_spawn.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/fiber_spawn.rb')
-rw-r--r-- | lib/rainbows/fiber_spawn.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rainbows/fiber_spawn.rb b/lib/rainbows/fiber_spawn.rb index ecf83d8..ec259ad 100644 --- a/lib/rainbows/fiber_spawn.rb +++ b/lib/rainbows/fiber_spawn.rb @@ -12,7 +12,6 @@ module Rainbows module FiberSpawn include Fiber::Base - include Rainbows::Acceptor def worker_loop(worker) # :nodoc: init_worker_process(worker) @@ -23,7 +22,7 @@ module Rainbows begin schedule do |l| break if G.cur >= limit - io = accept(l) or next + io = l.kgio_tryaccept or next ::Fiber.new { process_client(fio.new(io, ::Fiber.current)) }.resume end rescue => e |