package devkit

  1. Overview
  2. Docs

Unique process identification

type t = {
  1. host : string;
    (*

    machine hostname (no spaces allowed)

    *)
  2. id : int;
    (*

    process id

    *)
  3. name : string;
    (*

    application id (no spaces allowed), for information.

    *)
  4. stamp : int;
    (*

    stamp for uniqueness to guard against pid reuse

    *)
}
val dummy : t

dummy instance, use sparingly

val show : t -> string
  • returns

    pretty-printed pid (human readable)

val host : t -> string
  • returns

    machine hostname

val name : t -> string
  • returns

    application name

val to_string : t -> string
  • returns

    string representation of pid, can be read back by parse_pid_exn

val make : id:int -> host:string -> stamp:int -> string -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val parse_exn : string -> t

Current process identifier

val set_name : string -> unit
val self : unit -> t
val self_name : unit -> string
val self_as : string -> t
val show_self : unit -> string
val update : unit -> unit

call this to update Pid.self after fork

OCaml

Innovation. Community. Security.