package async_unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Wait : sig ... end

Wait exposes some internals of the implementation of wait and wait_untraced. Those functions return a deferred that becomes determined when a particular child process exits. The implementation, by default, installs a signal handler for SIGCHLD that calls check_all, which considers all undetermined wait results, calls wait_nohang, and fills them in if appropriate. If OCaml is being used as a plugin in some other process that is already managing signals, e.g. in Ecaml, then we can't install a signal handler. So, we expose do_not_handle_sigchld, which the plugin should call before any call to wait, and will prevent the SIGCHLD handler from being installed. It is then the responsibility of the plugin to call check_all regularly, so that child processes created by Async are reaped and the corresponding deferreds become determined.

val dns_lookup : name:string -> (unit -> 'a) -> 'a Async_kernel.Deferred.t

dns_lookup exposes the internals of how the DNS lookup functions run on the thread pool, so that we can validate in tests that those functions blocking doesn't block the entire scheduler's thread pool.

OCaml

Innovation. Community. Security.