Gateway HTTP/SSE server.
Clojure-native stack: reitit-ring routes -> Ring middleware -> the
Ring Jetty adapter on JDK virtual threads (:virtual-threads? true).
SSE is a Ring StreamableResponseBody that parks its virtual thread
on the connection: replay rides first, live events fan in under the
same output-stream monitor, a heartbeat comment keeps the pipe warm
and detects dead clients.
This is internal plumbing, not a channel: it registers no channel
descriptor and owns no renderer - it ships canonical IR and the
client renders (§4.1). Any host process (the vis serve daemon, a
TUI run, an embedded caller) can start it alongside whatever else it
is doing via start!.
Gateway HTTP/SSE server. Clojure-native stack: reitit-ring routes -> Ring middleware -> the Ring Jetty adapter on JDK virtual threads (`:virtual-threads? true`). SSE is a Ring `StreamableResponseBody` that parks its virtual thread on the connection: replay rides first, live events fan in under the same output-stream monitor, a heartbeat comment keeps the pipe warm and detects dead clients. This is internal plumbing, not a channel: it registers no channel descriptor and owns no renderer - it ships canonical IR and the client renders (§4.1). Any host process (the `vis serve` daemon, a TUI run, an embedded caller) can start it alongside whatever else it is doing via `start!`.
(auth-required?)True when this gateway instance demands the bearer token. OFF by
default on a loopback bind (a localhost single-user daemon — the
token dance is pure friction there); ALWAYS on for a non-loopback
bind; --require-token forces it on loopback too.
True when this gateway instance demands the bearer token. OFF by default on a loopback bind (a localhost single-user daemon — the token dance is pure friction there); ALWAYS on for a non-loopback bind; `--require-token` forces it on loopback too.
(register-routes! id contribution)Imperative escape hatch: register (or replace, by id) a route
contribution from an embedded/REPL caller. Extensions should prefer
the declarative :gateway.slot/http-routes channel-contribution slot
— the gateway pulls it with no registration call at all.
Imperative escape hatch: register (or replace, by `id`) a route contribution from an embedded/REPL caller. Extensions should prefer the declarative `:gateway.slot/http-routes` channel-contribution slot — the gateway pulls it with no registration call at all.
(serve-main! {:keys [port host token-file require-token?]})Blocking entry for the vis serve command: start, print the
connection line, park forever (Ctrl-C / SIGTERM stops the JVM).
Blocking entry for the `vis serve` command: start, print the connection line, park forever (Ctrl-C / SIGTERM stops the JVM).
(start!)(start! {:keys [port host token-file require-token?]})Start the gateway on the Ring Jetty adapter with virtual threads.
Returns {:port :host :token-file}. Throws when already running.
Safe to call from any host process - the daemon (vis serve), a TUI
run, or an embedded caller.
Start the gateway on the Ring Jetty adapter with virtual threads.
Returns `{:port :host :token-file}`. Throws when already running.
Safe to call from any host process - the daemon (`vis serve`), a TUI
run, or an embedded caller.(stop!)Stop the gateway server if running. Idempotent.
Stop the gateway server if running. Idempotent.
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 |