include sig ... end
val init : ?cluster:Import.Cluster.t ‑> ?close_stdout_and_stderr:bool ‑> unit ‑> Core.Pid.t
init
initializes the system and creates the master process. master_init
, if
specified, is called in the master process and may be used for cleanup/initialization
such as closing file descriptors. init
should be called before any threads are
created. If your program daemonizes, call init
after you daemonize, but before you
start the async scheduler. init
may only be called once.
If cluster
is specified, and it specifies a set of host names or ips that you can
ssh to without a password, and have permission to run programs on, then a master
process will also be started on these machines, and you will be able to spawn worker
processes on these machines. The current machine is implicitly included in the set of
available machines.
All the functions below are called in either the main process or a worker process.
val create_process : ?where:[ `Local | `On of string | `F of unit ‑> string ] ‑> unit ‑> (Async.Unix.Inet_addr.t * int) Core.Or_error.t Async.Deferred.t
Request a new process. Returns the ip/port where the new process may be reached. If
specified where
determines which machine the process will be spawned on, the default
is `Local (the current machine).