Crate tk_sendfile [−] [src]
A thread pool that can process file requests and send data to the socket with zero copy (using sendfile).
DiskPool structure to request file operations.
let pool = DiskPool::new(CpuPool::new(40)); pool.send("file", socket)
It's recommended to make large number of threads in the pool for three reasons:
- To make use of device parallelism
- To allow kernel to merge some disk operations
- To fix head of line blocking when some request reach disk but others could be served immediately from cache (we don't know which ones are cached, so we run all of them in a pool)
A reference to a thread pool for disk operations
File opener implementation that opens specified file path directly
A structure that tracks progress of sending a file
Future returned by
A trait that represents anything that file can be sent to
This trait represents anything that can open the file
This trait represents file that can atomically be read at specific point
Trait that represents something that can be converted into a file FileOpener