HVCP v1 transport boundary: a loopback TCP server that Vim sessions connect to, with request/response correlation, handshake, events and a port file.
Effectful. Framing and decisions come from hive-vim.protocol.codec.
HVCP v1 transport boundary: a loopback TCP server that Vim sessions connect to, with request/response correlation, handshake, events and a port file. Effectful. Framing and decisions come from hive-vim.protocol.codec.
(port server)The TCP port SERVER listens on.
The TCP port SERVER listens on.
(read-frame reader)Read the next frame from READER: one JSON value per line, as Vim's channel writes them. Returns ::eof at end of stream; an unparsable line comes back as {::unparsable line}, which the codec classifies as invalid.
Read the next frame from READER: one JSON value per line, as Vim's channel
writes them. Returns ::eof at end of stream; an unparsable line comes back
as {::unparsable line}, which the codec classifies as invalid.(request! server session-id op-fn timeout-ms)Send the op built by (OP-FN id) to session SESSION-ID and wait for Vim's reply. Returns (ok raw-result) or a :vim/timeout, :vim/disconnected or :vim/no-session error.
Send the op built by (OP-FN id) to session SESSION-ID and wait for Vim's reply. Returns (ok raw-result) or a :vim/timeout, :vim/disconnected or :vim/no-session error.
(select-session server selector)The session SELECTOR names, or the most recently active one when SELECTOR is nil or blank. Returns a Result holding the session id.
The session SELECTOR names, or the most recently active one when SELECTOR is nil or blank. Returns a Result holding the session id.
(send! server session-id op)Send a fire-and-forget op (no id) to SESSION-ID. Returns a Result.
Send a fire-and-forget op (no id) to SESSION-ID. Returns a Result.
(sessions server)Connected sessions, most recently active first.
Connected sessions, most recently active first.
(start! {:keys [port port-file emit-fn hello-timeout-ms clock-fn]
:or {port 0 hello-timeout-ms s/hello-timeout-ms}})Listen on loopback and accept Vim sessions.
opts: :port (0 picks a free port), :port-file (written with the bound port), :emit-fn (fn [event payload]) for :vim/connected :vim/event :vim/disconnected, :hello-timeout-ms, :clock-fn.
Listen on loopback and accept Vim sessions.
opts: :port (0 picks a free port), :port-file (written with the bound port),
:emit-fn (fn [event payload]) for :vim/connected :vim/event
:vim/disconnected, :hello-timeout-ms, :clock-fn.(stop! server)Stop accepting, disconnect every session and remove the port file.
Stop accepting, disconnect every session and remove the port file.
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 |