Liking cljdoc? Tell your friends :D

hive-system.process.liveness

Process liveness detection — single source of truth for is this pid alive? semantics across the hive ecosystem.

Use this instead of inlining kill -0, ProcessHandle/of, or backend- specific tricks. Liveness check is a system-level concern and belongs in hive-system (per the IProcess family of protocols), not in callers.

The LivenessSignal ADT is the closed sum of valid outcomes:

:liveness/alive — pid is owned by a live OS process :liveness/dead — pid was once valid but the process is gone (ESRCH) :liveness/unknown — pid is nil/non-integer, or the check itself raised transiently. Callers MUST NOT zombify on :unknown (degrade-soft semantics — protect against false positives during boot races, container migrations, and short-lived OS hiccups).

Process liveness detection — single source of truth for `is this pid alive?`
semantics across the hive ecosystem.

Use this instead of inlining `kill -0`, `ProcessHandle/of`, or backend-
specific tricks. Liveness check is a system-level concern and belongs in
hive-system (per the IProcess family of protocols), not in callers.

The `LivenessSignal` ADT is the closed sum of valid outcomes:

  :liveness/alive   — pid is owned by a live OS process
  :liveness/dead    — pid was once valid but the process is gone (ESRCH)
  :liveness/unknown — pid is nil/non-integer, or the check itself raised
                      transiently. Callers MUST NOT zombify on :unknown
                      (degrade-soft semantics — protect against false
                      positives during boot races, container migrations,
                      and short-lived OS hiccups).
raw docstring

->liveness-signalclj

(->liveness-signal kw__24488__auto__)

Coerce a keyword to a LivenessSignal variant (no data fields). Returns nil if keyword is not a valid variant.

Coerce a keyword to a LivenessSignal variant (no data fields).
Returns nil if keyword is not a valid variant.
sourceraw docstring

alive?clj

(alive? pid)

True iff the pid resolves to :liveness/alive. False on dead/unknown.

True iff the pid resolves to :liveness/alive. False on dead/unknown.
sourceraw docstring

check-pid-aliveclj

(check-pid-alive pid)

Return a LivenessSignal ADT value for the given pid.

Pure-ish: only side effect is asking the JVM about a numeric pid. No shell-out, no subprocess spawn — uses ProcessHandle.of which is a syscall-level lookup against the OS process table.

nil pid → :liveness/unknown non-integer pid → :liveness/unknown ProcessHandle.of throws → :liveness/unknown (degrade, do NOT zombify) handle present + alive → :liveness/alive handle absent OR !alive → :liveness/dead

Return a LivenessSignal ADT value for the given pid.

Pure-ish: only side effect is asking the JVM about a numeric pid.
No shell-out, no subprocess spawn — uses ProcessHandle.of which is a
syscall-level lookup against the OS process table.

  nil pid                 → :liveness/unknown
  non-integer pid         → :liveness/unknown
  ProcessHandle.of throws → :liveness/unknown   (degrade, do NOT zombify)
  handle present + alive  → :liveness/alive
  handle absent OR !alive → :liveness/dead
sourceraw docstring

dead?clj

(dead? pid)

True iff the pid resolves to :liveness/dead. False on alive/unknown. Use this when you only zombify on confirmed-dead — e.g. terminal-sweep pid-fallback when the addon channel itself errored.

True iff the pid resolves to :liveness/dead. False on alive/unknown.
Use this when you only zombify on confirmed-dead — e.g. terminal-sweep
pid-fallback when the addon channel itself errored.
sourceraw docstring

liveness-signalclj

(liveness-signal variant-kw__24485__auto__)
(liveness-signal variant-kw__24485__auto__ data__24486__auto__)

Construct a LivenessSignal variant. (liveness-signal variant-keyword) for enum variants (liveness-signal variant-keyword data-map) for data variants

Throws ex-info for unknown variants.

Construct a LivenessSignal variant.
(liveness-signal variant-keyword) for enum variants
(liveness-signal variant-keyword data-map) for data variants

Throws ex-info for unknown variants.
sourceraw docstring

liveness-signal?clj

(liveness-signal? x__24487__auto__)

True if x is a LivenessSignal ADT value.

True if x is a LivenessSignal ADT value.
sourceraw docstring

LivenessSignalclj

OS-level liveness check outcome. See ns docstring.

OS-level liveness check outcome. See ns docstring.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close