Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.gateway.server

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

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?]})

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

start!clj

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

stop!clj

(stop!)

Stop the gateway server if running. Idempotent.

Stop the gateway server if running. Idempotent.
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