Liking cljdoc? Tell your friends :D

bangmod.http-api.sse

The testable half of :method :sse: URL building and the a-data state transitions.

It exists as its own namespace because bangmod.http-api.internal requires ajax.core, which touches js/XMLHttpRequest at load time and so may not load under :node-test. Keeping the pure code out of there is what lets the reconnect POLICY be unit-tested even though the transport itself can only be verified in a browser.

The testable half of `:method :sse`: URL building and the `a-data` state transitions.

It exists as its own namespace because `bangmod.http-api.internal` requires `ajax.core`,
which touches `js/XMLHttpRequest` at load time and so may not load under `:node-test`.
Keeping the pure code out of there is what lets the reconnect POLICY be unit-tested even
though the transport itself can only be verified in a browser.
raw docstring

apply-messageclj/s

(apply-message state data)
source

backoff-msclj/s

(backoff-ms attempt)

Reconnect delay for attempt (0-based), capped at 30 s. Used only for a CLOSED EventSource — a CONNECTING one is already retrying on the server's retry: field.

Reconnect delay for `attempt` (0-based), capped at 30 s. Used only for a `CLOSED`
EventSource — a `CONNECTING` one is already retrying on the server's `retry:` field.
sourceraw docstring

initial-stateclj/s

(initial-state)
source

mark-errorclj/s

(mark-error state message)
source

mark-openclj/s

(mark-open state)
source

percent-encodeclj/s

(percent-encode s)
source

replace-path-paramsclj/s

(replace-path-params uri path-params)

:param placeholders in uri filled from path-params — the same rule bangmod.http-api.internal applies to a request URI.

`:param` placeholders in `uri` filled from `path-params` — the same rule
`bangmod.http-api.internal` applies to a request URI.
sourceraw docstring

stream-urlclj/s

(stream-url base-url uri path-params params token)

The full URL an EventSource is opened against.

EventSource cannot set request headers, so the bearer token travels as ?access_token= (RFC 6750 §2.3) — the one route in this API that accepts it.

The full URL an `EventSource` is opened against.

`EventSource` cannot set request headers, so the bearer token travels as
`?access_token=` (RFC 6750 §2.3) — the one route in this API that accepts it.
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