Liking cljdoc? Tell your friends :D

hive-compose.adapter.host

IProgramRunner over the host: processes through hive-system (process.core spawns, process.liveness answers for a pid, shell.core/exec! signals), build files through EDN reads.

A program starts as sh -c 'exec setsid <command> >> <log> 2>&1': the shell replaces itself with the program in a session of its own, so the spawned pid is the program's and its process group's. The group is what -stop! signals, which reaches the JVMs and node processes a watch forks. The pid is all that is kept, so a program outlives the addon and is stopped by pid after a restart.

Secret references in :program/env are read at -start! through the injected resolver (see hive-compose.adapter.secrets) and handed to the process only; nothing kept about a program carries them.

IProgramRunner over the host: processes through hive-system (`process.core`
spawns, `process.liveness` answers for a pid, `shell.core/exec!` signals),
build files through EDN reads.

A program starts as `sh -c 'exec setsid <command> >> <log> 2>&1'`: the shell
replaces itself with the program in a session of its own, so the spawned pid
is the program's and its process group's. The group is what `-stop!`
signals, which reaches the JVMs and node processes a watch forks. The pid is
all that is kept, so a program outlives the addon and is stopped by pid after
a restart.

Secret references in `:program/env` are read at `-start!` through the
injected resolver (see `hive-compose.adapter.secrets`) and handed to the
process only; nothing kept about a program carries them.
raw docstring

make-runnerclj

(make-runner opts)

HostRunner. opts: :spawn (default hive-system process.core/spawn!), :exec (default shell.core/exec!), :alive? (default process.liveness/alive?), :compose/stop-grace-ms before a group is killed (default 5000), :compose/resolver ({scheme ISecretBackend}, default the pass one over that exec) for the references in a program's env, :compose/systemd-scope? (default: whether a systemd user manager answers) to start each program in a transient systemd-run --user --scope of its own, outside the hive JVM's cgroup, so an OOM kill of hive does not take the programs with it. Without a user manager the program starts under setsid alone, as before.

HostRunner. `opts`: :spawn (default hive-system `process.core/spawn!`), :exec
(default `shell.core/exec!`), :alive? (default `process.liveness/alive?`),
:compose/stop-grace-ms before a group is killed (default 5000),
:compose/resolver ({scheme ISecretBackend}, default the `pass` one over that
exec) for the references in a program's env, :compose/systemd-scope? (default:
whether a systemd user manager answers) to start each program in a transient
`systemd-run --user --scope` of its own, outside the hive JVM's cgroup, so an
OOM kill of hive does not take the programs with it. Without a user manager
the program starts under setsid alone, as before.
sourceraw docstring

scope-unitclj

(scope-unit p now-ms)

Name of the transient systemd scope a program runs in: hc-<id>-<ms>. The time keeps a restarted program from colliding with a scope not yet collected.

Name of the transient systemd scope a program runs in: `hc-<id>-<ms>`. The
time keeps a restarted program from colliding with a scope not yet collected.
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