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.
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.
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, then stop every REPL this run started.
Serve requests from stdin until it closes, 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.
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 |