The process the Python glue talks to: ONE JSON object per line in, one out.
A project gets these tools by running this namespace with the Clojure CLI —
clojure -Sdeps '{:deps {com.blockether/vis-lang-clojure {:mvn/version "1.0.2"}}}' \
-M -m com.blockether.vis.lang.clojure.cli
— and keeping the process alive: managed nREPLs are ITS children, so a REPL
started by one call is still there for the next one. Each verb runs in a lane
(lanes). Verbs in different lanes run at the same time, so a lint or a format
does not wait for a test run. One lane answers its requests in order. Answers can
arrive out of order, and each answer carries the id of its request. EOF on stdin
ends the run: the lanes finish their requests, then every REPL it started stops.
A kept process never sees EOF, so it also ends after VIS_LANG_CLOJURE_IDLE_MINUTES
(default 30, 0 turns it off) without a request, while no request runs and no REPL is live.
Request: {"id": "7", "verb": "format", "root": "/proj", "session": "s1", "arg": …} Answer: {"id": "7", "ok": true, "result": …} {"id": "7", "ok": false, "error": {"message": …, "hint": …}}
Verbs: format, lint, test, repl-eval, repl (with op), ping. A ping
is answered at once, and its result names the lane of each verb.
The process the Python glue talks to: ONE JSON object per line in, one out.
A project gets these tools by running this namespace with the Clojure CLI —
clojure -Sdeps '{:deps {com.blockether/vis-lang-clojure {:mvn/version "1.0.2"}}}' \
-M -m com.blockether.vis.lang.clojure.cli
— and keeping the process alive: managed nREPLs are ITS children, so a REPL
started by one call is still there for the next one. Each verb runs in a lane
([[lanes]]). Verbs in different lanes run at the same time, so a lint or a format
does not wait for a test run. One lane answers its requests in order. Answers can
arrive out of order, and each answer carries the id of its request. EOF on stdin
ends the run: the lanes finish their requests, then every REPL it started stops.
A kept process never sees EOF, so it also ends after `VIS_LANG_CLOJURE_IDLE_MINUTES`
(default 30, 0 turns it off) without a request, while no request runs and no REPL is live.
Request: {"id": "7", "verb": "format", "root": "/proj", "session": "s1", "arg": …}
Answer: {"id": "7", "ok": true, "result": …}
{"id": "7", "ok": false, "error": {"message": …, "hint": …}}
Verbs: `format`, `lint`, `test`, `repl-eval`, `repl` (with `op`), `ping`. A `ping`
is answered at once, and its result names the lane of each verb.(-main & _args)Serve requests from stdin until it closes or the process is idle, then stop every REPL this run started.
Serve requests from stdin until it closes or the process is idle, then stop every REPL this run started.
(handle request)Run ONE request and answer it. Total: a thrown exception is an answer too, so a bad argument never takes the process down with the request that made it.
Run ONE request and answer it. Total: a thrown exception is an answer too, so a bad argument never takes the process down with the request that made it.
Environment variable that sets the idle limit in minutes.
Environment variable that sets the idle limit in minutes.
(idle-limit-ms value)The idle limit in milliseconds from the value of idle-env, or nil when it is off.
A blank or unreadable value gives the default.
The idle limit in milliseconds from the value of [[idle-env]], or nil when it is off. A blank or unreadable value gives the default.
(idle? {:keys [busy since]} now limit-ms repls-live?)True when the process can end: no request runs, none came for limit-ms and no
REPL is live.
True when the process can end: no request runs, none came for `limit-ms` and no REPL is live.
The lane of each verb. Verbs in different lanes run at the same time. One lane runs
its requests one after another, in the order they came. test, repl-eval and
repl share a lane, because each one can use the same managed nREPL.
The lane of each verb. Verbs in different lanes run at the same time. One lane runs its requests one after another, in the order they came. `test`, `repl-eval` and `repl` share a lane, because each one can use the same managed nREPL.
(stop-repls!)Stop every managed nREPL this process started, and detach every external one it attached. Called on the way out, so a client that goes away does not leave JVMs behind.
Stop every managed nREPL this process started, and detach every external one it attached. Called on the way out, so a client that goes away does not leave JVMs behind.
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 |