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.
ma_state sched returns the state of the moving average worker.
val write : ?canceler:Lwt_canceler.t -> connection -> Bytes.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
write conn msg returns
Ok () when
msg has been added to
conn's write queue, or fail with an error.
write_now conn msg is
msg has been (immediately) added to
conn's write queue,
false if it has been dropped.
readable of an abstract
stat conn is a snapshot of current bandwidth usage for
global_stat sched is a snapshot of
sched's bandwidth usage (sum of
stat conn for each
iter_connection sched f applies
f on each connection managed by
close conn returns after any pending data has been sent and the canceler of
conn has been triggered.
It does not wait for the canceler callbacks, so there is no guarantee that the file descriptor is already closed, but it will eventually be closed.
If timeout is set, the canceler will be triggered after the timeout, even if pending data remains to be sent.
shutdown sched returns after all connections managed by
sched have been closed and
sched's inner worker has successfully canceled.
val id : connection -> int
id connection returns the identifier of the underlying
P2p_fd.t file descriptor. This uniquely identifies a connection.