Liking cljdoc? Tell your friends :D

bushka.server

HTTP + WebSocket serving via http-kit — a JVM mirror of bun.server. WebSocket pub/sub is hand-tracked per topic in an atom (http-kit has no built-in topics). See docs/MIRROR.md.

HTTP + WebSocket serving via http-kit — a JVM mirror of `bun.server`.
WebSocket pub/sub is hand-tracked per topic in an atom (http-kit has no
built-in topics). See `docs/MIRROR.md`.
raw docstring

publish!clj

(publish! {:keys [topics]} topic message)

Sends message to every WebSocket channel subscribed to topic. Returns the count.

Sends message to every WebSocket channel subscribed to topic. Returns the count.
raw docstring

start!clj

(start! {:keys [port hostname fetch] :or {port 0 hostname "0.0.0.0"}})

Starts an HTTP server. opts: :port (0=random), :hostname (default "0.0.0.0"), :fetch (fn [req handle] -> ring-response). Returns {:native stop-fn :port int :hostname str :url "http://host:port" :topics atom}. Throws {:type :server-error :reason :port-in-use|:start-failed …} on bind failure.

Starts an HTTP server. opts: :port (0=random), :hostname (default "0.0.0.0"),
:fetch (fn [req handle] -> ring-response). Returns
{:native stop-fn :port int :hostname str :url "http://host:port" :topics atom}.
Throws {:type :server-error :reason :port-in-use|:start-failed …} on bind failure.
raw docstring

stop!clj

(stop! {:keys [native]})

Stops the server synchronously. Returns nil.

Stops the server synchronously. Returns nil.
raw docstring

upgrade!clj

(upgrade! handle req topic)
(upgrade! {:keys [topics] :as _handle} req topic initial-fn)

Upgrades req to a WebSocket subscribed to topic. With initial-fn, sends (initial-fn) to the new channel on open when it returns non-nil. Returns the as-channel response.

Upgrades req to a WebSocket subscribed to `topic`. With initial-fn, sends
(initial-fn) to the new channel on open when it returns non-nil. Returns the
as-channel response.
raw 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