Expand description
A thread pool that can process file requests and send data to the socket with zero copy (using sendfile).
Use DiskPool
structure to request file operations.
§Example
ⓘ
let pool = DiskPool::new(CpuPool::new(40));
pool.send("file", socket)
§Settings
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)
Structs§
- Disk
Pool - A reference to a thread pool for disk operations
- Path
Opener - File opener implementation that opens specified file path directly
- Sendfile
- A structure that tracks progress of sending a file
- Write
File - Future returned by
Sendfile::write_into()
Traits§
- Destination
- A trait that represents anything that file can be sent to
- File
Opener - This trait represents anything that can open the file
- File
Reader - This trait represents file that can atomically be read at specific point
- Into
File Opener - Trait that represents something that can be converted into a file FileOpener