Liking cljdoc? Tell your friends :D

hive-tmux.observe.hook-plan

Pure planning of the tmux set-hook invocations that install and remove ingestion.

The plan is DATA: a vector of argv vectors. Nothing here runs tmux, so the whole installation surface is testable without a server, and the boundary that does run it stays a one-liner.

Pure planning of the tmux `set-hook` invocations that install and remove
ingestion.

The plan is DATA: a vector of argv vectors. Nothing here runs tmux, so the
whole installation surface is testable without a server, and the boundary
that does run it stays a one-liner.
raw docstring

hive-tmux.observe.ingest

Joins a hook arrival to the registry and the event system.

Effects arrive as an injected map (:registry :deregister! :dispatch!) rather than as direct calls on hive-tmux.state and hive-events, so the whole arrival path is exercised against recording fns.

Joins a hook arrival to the registry and the event system.

Effects arrive as an injected map (`:registry` `:deregister!` `:dispatch!`)
rather than as direct calls on `hive-tmux.state` and `hive-events`, so the
whole arrival path is exercised against recording fns.
raw docstring

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

hive-tmux.observe.listener

UNIX-socket boundary: accepts hook arrivals and hands each decoded event to an injected dispatch fn.

The dispatch fn is an argument rather than a direct hive-events call, so the accept loop is exercised in tests against a recording fn and carries no dependency on the event system it feeds.

Binding follows STD-04 T2/T3 through hive-system.network.unix: the socket directory is 0700, the socket 0600, and an existing path is connect-probed first. A stale socket is replaced; a LIVE one is never unlinked, so a second listener on the same path does not start and the first keeps receiving.

The adapter's bind! and close-server! take a lock file with no deadline. Addon init and shutdown must not hang on it, so both run on a helper thread with a deadline (bind-deadline-ms): past it the listener is left not started (bind), or its channel is closed without the unlink (close; the next bind probes the file stale and removes it).

UNIX-socket boundary: accepts hook arrivals and hands each decoded event to
an injected dispatch fn.

The dispatch fn is an argument rather than a direct `hive-events` call, so
the accept loop is exercised in tests against a recording fn and carries no
dependency on the event system it feeds.

Binding follows STD-04 T2/T3 through hive-system.network.unix: the socket
directory is 0700, the socket 0600, and an existing path is connect-probed
first. A stale socket is replaced; a LIVE one is never unlinked, so a
second listener on the same path does not start and the first keeps
receiving.

The adapter's bind! and close-server! take a lock file with no deadline.
Addon init and shutdown must not hang on it, so both run on a helper
thread with a deadline (`bind-deadline-ms`): past it the listener is left
not started (bind), or its channel is closed without the unlink (close;
the next bind probes the file stale and removes it).
raw docstring

hive-tmux.observe.reconcile

Turns one hook arrival into a registry action.

The registry is keyed by ling-id while an arrival carries only a pane-id, so reconciling needs a reverse lookup. Planning is pure over a registry VALUE: the decision is testable without a registry, a tmux server or a socket, and the boundary that performs it stays a case over the plan.

Turns one hook arrival into a registry action.

The registry is keyed by ling-id while an arrival carries only a pane-id, so
reconciling needs a reverse lookup. Planning is pure over a registry VALUE:
the decision is testable without a registry, a tmux server or a socket, and
the boundary that performs it stays a `case` over the plan.
raw docstring

hive-tmux.observe.schema

Malli value objects for tmux-originated event ingestion.

JVM-only on purpose: malli arrives as a :mvn/version coordinate, which ClojureWasm does not resolve. The portable half of the subsystem lives in hive-tmux.observe.wire and carries no contracts of its own; these schemas describe its values from the JVM side, where they can be enforced and can generate tests.

Malli value objects for tmux-originated event ingestion.

JVM-only on purpose: malli arrives as a `:mvn/version` coordinate, which
ClojureWasm does not resolve. The portable half of the subsystem lives in
`hive-tmux.observe.wire` and carries no contracts of its own; these schemas
describe its values from the JVM side, where they can be enforced and can
generate tests.
raw docstring

hive-tmux.observe.socket-path

Where the observe socket lives (STD-04 T2), as a pure rule the ClojureWasm hook client can load.

Rule: $XDG_RUNTIME_DIR/hive/tmux-observe.sock when XDG_RUNTIME_DIR is set <tmpdir>/hive-<uid>/tmux-observe.sock otherwise and the path is at most max-path-bytes UTF-8 bytes.

This is a COPY of hive-system.network.path (hive-system 0.4.4), which the JVM listener calls. The hook client cannot: ClojureWasm resolves only :git/url and :local/root coordinates, so like wire this namespace requires nothing outside clojure.core and clojure.string. Results are the plain maps hive-dsl uses ({:ok v} or {:error category ...}), so the two copies compare directly. They cannot drift unnoticed: test/hive_tmux/observe/socket_path_test.clj runs both on the shared vectors in socket_path_vectors.edn and on generated inputs.

Effects (reading the environment and the uid) stay with the caller.

Where the observe socket lives (STD-04 T2), as a pure rule the ClojureWasm
hook client can load.

Rule:
  $XDG_RUNTIME_DIR/hive/tmux-observe.sock        when XDG_RUNTIME_DIR is set
  <tmpdir>/hive-<uid>/tmux-observe.sock          otherwise
and the path is at most `max-path-bytes` UTF-8 bytes.

This is a COPY of hive-system.network.path (hive-system 0.4.4), which the
JVM listener calls. The hook client cannot: ClojureWasm resolves only
`:git/url` and `:local/root` coordinates, so like `wire` this namespace
requires nothing outside clojure.core and clojure.string. Results are the
plain maps hive-dsl uses ({:ok v} or {:error category ...}), so the two
copies compare directly. They cannot drift unnoticed:
test/hive_tmux/observe/socket_path_test.clj runs both on the shared
vectors in socket_path_vectors.edn and on generated inputs.

Effects (reading the environment and the uid) stay with the caller.
raw docstring

hive-tmux.observe.wire

Wire format shared by the JVM listener and the cljw hook client.

This namespace is loaded by ClojureWasm, which resolves only :git/url and :local/root coordinates. It therefore requires nothing outside clojure.core and clojure.edn, and must stay that way: a :mvn/version dependency reached from here is silently skipped by cljw and fails at call time rather than load time.

Wire format shared by the JVM listener and the cljw hook client.

This namespace is loaded by ClojureWasm, which resolves only `:git/url` and
`:local/root` coordinates. It therefore requires nothing outside
`clojure.core` and `clojure.edn`, and must stay that way: a `:mvn/version`
dependency reached from here is silently skipped by cljw and fails at call
time rather than load time.
raw 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