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.Longest socket path, in UTF-8 bytes, the rule accepts.
Longest socket path, in UTF-8 bytes, the rule accepts.
(proc-status-uid text)The real uid in the text of /proc/self/status (its Uid: line), or nil.
The hook client's only source of the uid: ClojureWasm has no getuid.
The real uid in the text of /proc/self/status (its `Uid:` line), or nil. The hook client's only source of the uid: ClojureWasm has no getuid.
The T2 service name of the observe socket.
The T2 service name of the observe socket.
(socket-dir env tmpdir uid)The directory hive sockets of this user live in. env maps environment
variable names to values; tmpdir is java.io.tmpdir; uid the numeric
user id. => {:ok dir} or {:error ...}
The directory hive sockets of this user live in. `env` maps environment
variable names to values; `tmpdir` is java.io.tmpdir; `uid` the numeric
user id. => {:ok dir} or {:error ...}(socket-file-name svc)(socket-file-name svc id)<service>[-<id>].sock, after checking both names. => {:ok name} or {:error ...}
<service>[-<id>].sock, after checking both names. => {:ok name} or {:error ...}
(socket-path env tmpdir uid svc)(socket-path env tmpdir uid svc id)The socket path of svc (and optional id) under the T2 rule; refuses a
path longer than max-path-bytes UTF-8 bytes.
=> {:ok {:path :dir}} or {:error ...}
The socket path of `svc` (and optional `id`) under the T2 rule; refuses a
path longer than `max-path-bytes` UTF-8 bytes.
=> {:ok {:path :dir}} or {:error ...}(utf8-length s)Number of bytes s takes in UTF-8.
Number of bytes `s` takes in UTF-8.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |