package riot

  1. Overview
  2. Docs
type strategy =
  1. | One_for_one
    (*

    If one child process terminates and is to be restarted, only that child process is affected. This is the default restart strategy.

    *)
  2. | One_for_all
    (*

    If one child process terminates and is to be restarted, all other child processes are terminated and then all child processes are restarted.

    *)
  3. | Rest_for_one
    (*

    If one child process terminates and is to be restarted, the 'rest' of the child processes (that is, the child processes after the terminated child process in the start order) are terminated. Then the terminated child process and all child processes after it are restarted.

    *)
  4. | Simple_one_for_one
    (*

    A simplified one_for_one supervisor, where all child processes are dynamically added instances of the same process type, that is, running the same code.

    *)
type child_spec
val child_spec : ('state -> (Pid.t, [> `Exit of exn ]) result) -> 'state -> child_spec

Create a new child specification to be used with start_link

val start_child : child_spec -> Pid.t

Describe and start a supervisor

OCaml

Innovation. Community. Security.