diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-03-10 15:06:10 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-03-10 15:06:10 -0800 |
commit | cd8a874d18fe01e11bb57b91186b6c9f712a4b3f (patch) | |
tree | a8400f2e6eeca1a4d4a686e138b97eb831eb9a8d /lib/rainbows/writer_thread_spawn | |
parent | afea5cd7c691de95b37d29728ab4880e3b737a42 (diff) | |
download | rainbows-cd8a874d18fe01e11bb57b91186b6c9f712a4b3f.tar.gz |
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.
Diffstat (limited to 'lib/rainbows/writer_thread_spawn')
-rw-r--r-- | lib/rainbows/writer_thread_spawn/client.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/writer_thread_spawn/client.rb b/lib/rainbows/writer_thread_spawn/client.rb index b4166fa..3106253 100644 --- a/lib/rainbows/writer_thread_spawn/client.rb +++ b/lib/rainbows/writer_thread_spawn/client.rb @@ -21,7 +21,7 @@ class Rainbows::WriterThreadSpawn::Client < Struct.new(:to_io, :q, :thr) } end - if IO.respond_to?(:copy_stream) || IO.method_defined?(:sendfile_nonblock) + if IO.respond_to?(:copy_stream) || IO.method_defined?(:trysendfile) def write_response(status, headers, body, alive) self.q ||= queue_writer if body.respond_to?(:close) |