Gateway HTTP/SSE server.
Clojure-native stack: reitit-ring routes -> Ring middleware -> a Jetty 12
CORE handler (ring.adapter.jetty9 — no servlet layer) on JDK virtual
threads (:virtual-threads? true).
SSE is a Ring StreamableResponseBody whose virtual thread is the
connection's SINGLE socket writer: replay rides first, then it drains a
bounded per-connection event queue that state/fan-out! enqueues onto,
emitting a heartbeat comment on idle to keep the pipe warm and detect
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-agent gateway start 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 -> a Jetty 12 CORE handler (`ring.adapter.jetty9` — no servlet layer) on JDK virtual threads (`:virtual-threads? true`). SSE is a Ring `StreamableResponseBody` whose virtual thread is the connection's SINGLE socket writer: replay rides first, then it drains a bounded per-connection event queue that `state/fan-out!` enqueues onto, emitting a heartbeat comment on idle to keep the pipe warm and detect 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-agent gateway start` 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.
(local-handler)Build the SDK handler for an owned stdio engine, without opening HTTP listeners. The caller owns process lifetime and must select an isolated database.
Build the SDK handler for an owned stdio engine, without opening HTTP listeners. The caller owns process lifetime and must select an isolated database.
(register-contributed-sse! stream-id close!)Count a contributed SSE connection in the gateway's existing client lifecycle.
Count a contributed SSE connection in the gateway's existing client lifecycle.
(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? db managed? pair?]})Blocking entry for the vis-agent gateway start command: start, print the
connection line, park forever (Ctrl-C / SIGTERM stops the JVM).
Blocking entry for the `vis-agent gateway start` command: start, print the connection line, park forever (Ctrl-C / SIGTERM stops the JVM).
(start!)(start! {:keys [port host token-file require-token? db managed?]})Start the gateway on the Jetty 12 core adapter with virtual threads.
Returns {:port :host :token-file}. Throws when already running.
Safe to call from any host process - the daemon (vis-agent gateway start), a TUI
run, or an embedded caller.
Start the gateway on the Jetty 12 core adapter with virtual threads.
Returns `{:port :host :token-file}`. Throws when already running.
Safe to call from any host process - the daemon (`vis-agent gateway start`), a TUI
run, or an embedded caller.(stop!)Stop the gateway server if running. Idempotent.
Stop the gateway server if running. Idempotent.
(unregister-contributed-sse! stream-id)Remove a contributed SSE connection and re-run managed-idle shutdown policy.
Remove a contributed SSE connection and re-run managed-idle shutdown policy.
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 |