

Just like we require real File objects for the Is not compatible with the socket operations in FastSend. Note that WebBrick only supports partial hijacking using a self-pipe, which We use FastSend on Puma pretty muchĮxclusively, and it works well. Your webserver (Rack adapter) must support partial Rack hijacking. Has to dispatch a request (you do not have to require these two in a particular order). Java's NIO transferTo() call - if you are on jRubyįor the "sendfile" gem to work you need to add it to your application and require it before FastSend.blocking sendfile(2) call - if you have the "sendfile" gem, only on MRI/Rubinius, also works on OSX.

non-blocking sendfile(2) call - if you have the "sendfile" gem, only on MRI/Rubinius, only on Linux.Implementation detailsįundamentally, FastSend takes your Ruby File handles, one by one (you can yield multiple times from each_file)Īnd uses the fastest way possible, as available in your Ruby runtime, to send the file to the Rack webserver socket. Of how much data the client could read/buffer so far before the connection went down. There are also more callbacks you can use, read the class documentation for more information on them.įor example, you can subscribe to a callback when the client suddenly disconnects - you will get an idea

Bytes_sent_proc = ->(sent,written_so_far_entire_response), large_body]
