package riot

  1. Overview
  2. Docs
val spawn : (unit -> unit) -> Core.Pid.t
val monitor : Core.Pid.t -> Core.Pid.t -> unit
val exit : Core.Pid.t -> Core.Process.exit_reason -> unit
val flag : Core.Process.process_flag -> unit
val register : string -> Core.Pid.t -> unit
val unregister : string -> unit
type exit_reason = Core.Process.exit_reason =
  1. | Normal
  2. | Exit_signal
  3. | Exception of exn
module Messages = Core.Process.Messages
type state = Core.Process.state =
  1. | Runnable
  2. | Waiting_message
  3. | Waiting_io of {
    1. syscall : string;
    2. mode : [ `r | `rw | `w ];
    3. fd : Util.Fd.t;
    }
  4. | Running
  5. | Exited of exit_reason
  6. | Finalized
type process_flags = Core.Process.process_flags = {
  1. trap_exits : bool Atomic.t;
}
type process_flag = Core.Process.process_flag =
  1. | Trap_exit of bool
val default_flags : unit -> process_flags
type t = Core.Process.t = {
  1. pid : Core.Pid.t;
  2. sid : Core.Scheduler_uid.t;
  3. flags : process_flags;
  4. state : state Atomic.t;
  5. mutable cont : exit_reason Core.Proc_state.t;
  6. mailbox : Core.Mailbox.t;
  7. save_queue : Core.Mailbox.t;
  8. mutable read_save_queue : bool;
  9. monitors : Core.Pid.t list Atomic.t;
}
exception Process_reviving_is_forbidden of t
val make : Core.Scheduler_uid.t -> (unit -> exit_reason) -> t
val pp : Format.formatter -> t -> unit
val pp_state : Format.formatter -> state -> unit
val pp_reason : Format.formatter -> exit_reason -> unit
val pp_flags : Format.formatter -> process_flags -> unit
val pid : t -> Core.Pid.t
val sid : t -> Core.Scheduler_uid.t
val state : t -> state
val monitors : t -> Core.Pid.t list
val is_alive : t -> bool
val is_exited : t -> bool
val is_waiting : t -> bool
val is_waiting_io : t -> bool
val is_runnable : t -> bool
val is_running : t -> bool
val is_finalized : t -> bool
val has_empty_mailbox : t -> bool
val has_messages : t -> bool
val message_count : t -> int
val should_awake : t -> bool
val mark_as_awaiting_io : t -> string -> [ `r | `rw | `w ] -> Util.Fd.t -> unit
val mark_as_awaiting_message : t -> unit
val mark_as_running : t -> unit
val mark_as_runnable : t -> unit
val mark_as_exited : t -> exit_reason -> unit
val mark_as_finalized : t -> unit
val set_flag : t -> process_flag -> unit
val set_cont : t -> exit_reason Core.Proc_state.t -> unit
val add_monitor : t -> Core.Pid.t -> unit
val next_message : t -> Core.Message.envelope option
val add_to_save_queue : t -> Core.Message.envelope -> unit
val read_save_queue : t -> unit
val send_message : t -> Core.Message.t -> unit
OCaml

Innovation. Community. Security.