Legend:
Library
Module
Module type
Parameter
Class
Class type
Scheduling of I/O operations over file descriptors.
This module defines the scheduler type t, and connection type connection. A connection is a wrapper over a P2p_fd.t. R/W functions over connections behave like regular R/W over file descriptors, but the scheduler ensures of fair allocation of bandwidth between them.
To each connection is associated a read (resp. write) queue where data is copied to (resp. read from), at a rate of max_download_speed /
num_connections (resp. max_upload_speed / num_connections).
type connection
Type of a connection.
type t
Type of an IO scheduler.
val create :
?max_upload_speed:int ->?max_download_speed:int ->?read_queue_size:int ->?write_queue_size:int ->read_buffer_size:int ->unit ->t
create ~max_upload_speed ~max_download_speed ~read_queue_size
~write_queue_size () is an IO scheduler with specified (global) max upload (resp. download) speed, and specified read (resp. write) queue sizes (in bytes) for connections.