Module Async_unix__.Epoll_file_descr_watcher
type 'a additional_create_args= timerfd:Core.Linux_ext.Timerfd.t -> 'a
include Async_unix__.File_descr_watcher_intf.S with type 'a additional_create_args := 'a additional_create_args
type tA file-descr-watcher is essentially a map from
File_descr.ttobool Read_write.t, which defines the set of file descriptors being watched, and for each file descriptor, whether it is being watched for read, write, or both. If a file descriptor is not being watched for either, it is not in the map.
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
include Async_unix__.Import.Invariant.S with type t := t
val invariant : t Base__.Invariant_intf.inv
type 'a additional_create_argsadditional_create_argsabstracts over the additional arguments to different file-descr-watcher'screatefunction.
val create : (num_file_descrs:int -> handle_fd_read_ready:(Async_unix__.Import.File_descr.t -> unit) -> handle_fd_write_ready:(Async_unix__.Import.File_descr.t -> unit) -> t) additional_create_argscreate ~num_file_descrscreates a new file-descr-watcher that is able to watch file descriptors in[0, num_file_descrs).
val backend : Async_unix__.Config.File_descr_watcher.tval set : t -> Async_unix__.Import.File_descr.t -> bool Async_unix__.Read_write.t -> unitsetalters the map of file descriptors being watched. It will take effect on the next call tothread_safe_check. Callingset fdwith{ read = false, write = false }removesfdfrom the map.
val iter : t -> f:(Async_unix__.Import.File_descr.t -> Async_unix__.Read_write.Key.t -> unit) -> unititer t ~fiterates over every file descriptor in the map, applyfto it once for each of {`Read,`Write} that it is being watched for.
module Pre : sig ... endpre_check tdoes whatever non-thread-safe work is necessary to prepare for the system call that checks file descriptors being ready for read or write.pre_checkdoes not side effectt.
module Check_result : sig ... endthread_safe_check t pre timeout span_or_unitchecks the file descriptors for their status and returns when at least one is available, or thetimeout, span_or_unitpasses.thread_safe_checkdoes not side effectt. Unlike the rest of the functions in this module,thread_safe_checkis thread safe.
val thread_safe_check : t -> Pre.t -> 'a Async_unix__.File_descr_watcher_intf.Timeout.t -> 'a -> Check_result.tval post_check : t -> Check_result.t -> unitpost_check t check_resultcalls thehandle_fd*functions supplied tocreate:1. for each file descriptor that is ready to be written to, then 2. for each file descriptor that is ready to be read from.
We handle writes before reads so that we get all the writes started going to the external world before we process all the reads. This will nicely batch together all the output based on the reads for the next writes.
It is guaranteed that it calls
handle_fd_read*only on anfdthat is watched for read as perset, andhandle_fd_write*only on anfdthat is watched for write as perset.
val reset_in_forked_process : t -> unit