(set-auth-token-provider! f)Registers a 0-arg fn that returns the current access token (or nil).
Registers a 0-arg fn that returns the current access token (or nil).
(subscribe api-name
endpoint-name
{:keys [path-params params on-open on-message on-error] :as _opts})Opens an SSE subscription against an endpoint declared :method :sse.
Reconnect is owned here, on a readyState split: CONNECTING means EventSource is already
retrying on the server's retry: field, so we only report the drop; CLOSED means it
gave up — which per the HTML spec is what a non-200 status or a wrong Content-Type
produces, i.e. our 401 and our 503 — so we re-open on a backoff, re-reading the token
from auth-token-provider at open time, every time.
Opens an SSE subscription against an endpoint declared `:method :sse`. Reconnect is owned here, on a readyState split: `CONNECTING` means EventSource is already retrying on the server's `retry:` field, so we only report the drop; `CLOSED` means it gave up — which per the HTML spec is what a non-200 status or a wrong Content-Type produces, i.e. our 401 and our 503 — so we re-open on a backoff, re-reading the token from `auth-token-provider` at open time, every time.
(unsubscribe! handle)Closes the EventSource and cancels any pending reconnect.
Closes the EventSource and cancels any pending reconnect.
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 |