Liking cljdoc? Tell your friends :D

hive-tmux.observe.lifecycle

Start and stop tmux-originated ingestion for the addon.

Installing hooks is OPT-IN and off by default. set-hook -g is a persistent, server-wide change to the operator's tmux, and an addon that rewrites it on every init would be editing an environment it does not own. The listener itself is inert (a socket nobody writes to), so it starts by default and the operator turns on the half that touches their server.

Start and stop tmux-originated ingestion for the addon.

Installing hooks is OPT-IN and off by default. `set-hook -g` is a persistent,
server-wide change to the operator's tmux, and an addon that rewrites it on
every init would be editing an environment it does not own. The listener
itself is inert (a socket nobody writes to), so it starts by default and the
operator turns on the half that touches their server.
raw docstring

config->observeclj

(config->observe config)

The ingestion config carried by addon CONFIG, with defaults applied.

The ingestion config carried by addon CONFIG, with defaults applied.
sourceraw docstring

default-client-cmdclj

(default-client-cmd)

The command tmux runs per hook firing.

Prefers the compiled client named by $HIVE_TMUX_HOOK_BIN, else the one installed at ~/.local/bin/hive-tmux-hook, and falls back to running the source through cljw.

Compiling buys no speed (both start in ~17ms), so the reason to prefer the binary is that it is self-contained: tmux runs a hook with a cwd the addon does not own, and the interpreted form needs a relative classpath, the source tree, and prints a deps.edn note on every firing.

The command tmux runs per hook firing.

Prefers the compiled client named by `$HIVE_TMUX_HOOK_BIN`, else the one
installed at `~/.local/bin/hive-tmux-hook`, and falls back to running the
source through cljw.

Compiling buys no speed (both start in ~17ms), so the reason to prefer the
binary is that it is self-contained: tmux runs a hook with a cwd the addon
does not own, and the interpreted form needs a relative classpath, the
source tree, and prints a deps.edn note on every firing.
sourceraw docstring

default-socket-pathclj

(default-socket-path)

Where the listener binds when the operator names no path.

Prefers $XDG_RUNTIME_DIR, which is per-user and cleared on logout, so a stale socket cannot outlive the session that made it. The path must stay under the OS 108-byte sun_path cap, which a runtime dir comfortably does.

Where the listener binds when the operator names no path.

Prefers `$XDG_RUNTIME_DIR`, which is per-user and cleared on logout, so a
stale socket cannot outlive the session that made it. The path must stay
under the OS 108-byte `sun_path` cap, which a runtime dir comfortably does.
sourceraw docstring

enabled?clj

(enabled? config)

Whether ingestion runs at all. Default true: the listener is inert.

Whether ingestion runs at all. Default true: the listener is inert.
sourceraw docstring

install-hooks?clj

(install-hooks? config)

Whether to write set-hook -g into the operator's tmux server.

Default FALSE. This is the only part of ingestion that modifies something outside hive, so it is never on by accident.

Whether to write `set-hook -g` into the operator's tmux server.

Default FALSE. This is the only part of ingestion that modifies something
outside hive, so it is never on by accident.
sourceraw docstring

start!clj

(start! config)
(start! config run!)

Start ingestion for addon CONFIG. Returns a handle for stop!, or nil when disabled. Never throws: ingestion is an enhancement, and a failure to start it must not fail addon initialization.

Start ingestion for addon CONFIG. Returns a handle for `stop!`, or nil when
disabled. Never throws: ingestion is an enhancement, and a failure to start
it must not fail addon initialization.
sourceraw docstring

stop!clj

(stop! handle)
(stop! {:keys [listener observe hooks-installed?]} run!)

Stop ingestion, removing any hooks this addon installed.

Hooks are removed only when start! installed them: unsetting a hook the operator wrote by hand would be destroying their configuration.

Stop ingestion, removing any hooks this addon installed.

Hooks are removed only when `start!` installed them: unsetting a hook the
operator wrote by hand would be destroying their configuration.
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