switch from IO#sendfile_nonblock to IO#trysendfile
commitcd8a874d18fe01e11bb57b91186b6c9f712a4b3f
authorEric Wong <normalperson@yhbt.net>
Thu, 10 Mar 2011 23:06:10 +0000 (10 15:06 -0800)
committerEric Wong <normalperson@yhbt.net>
Thu, 10 Mar 2011 23:06:10 +0000 (10 15:06 -0800)
treea8400f2e6eeca1a4d4a686e138b97eb831eb9a8d
parentafea5cd7c691de95b37d29728ab4880e3b737a42
switch from IO#sendfile_nonblock to IO#trysendfile

IO#trysendfile does not raise exceptions for common EAGAIN
errors, making it far less expensive to use with the following
concurrency models:

* Coolio
* CoolioFiberSpawn
* Revactor
* FiberSpawn
* FiberPool

This requires the new sendfile 1.1.0 RubyGem and removes support
for the sendfile 1.0.0.  All sendfile users must upgrade or be
left without sendfile(2) support.  IO#sendfile behaves the same
if you're using a multi-threaded concurrency option, but we
don't detect nor use it unless IO#trysendfile exists.
TODO
lib/rainbows/coolio/client.rb
lib/rainbows/epoll/client.rb
lib/rainbows/fiber/body.rb
lib/rainbows/response.rb
lib/rainbows/revactor/client/methods.rb
lib/rainbows/stream_file.rb
lib/rainbows/writer_thread_pool/client.rb
lib/rainbows/writer_thread_spawn/client.rb