Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.gateway.server

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!`.
raw docstring

auth-required?clj

(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.
sourceraw docstring

deregister-routes!clj

(deregister-routes! id)
source

local-handlerclj

(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.
sourceraw docstring

register-contributed-sse!clj

(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.
sourceraw docstring

register-routes!clj

(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.
sourceraw docstring

running?clj

(running?)
source

serve-main!clj

(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).
sourceraw docstring

start!clj

(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.
sourceraw docstring

stop!clj

(stop!)

Stop the gateway server if running. Idempotent.

Stop the gateway server if running. Idempotent.
sourceraw docstring

unregister-contributed-sse!clj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close