Liking cljdoc? Tell your friends :D

immutant.web.sse

Provides Server-Sent Events via immutant.web.async/as-channel

Provides Server-Sent Events via [[immutant.web.async/as-channel]]
raw docstring

as-channelclj

Decorates the result of immutant.web.async/as-channel with the proper SSE Content-Type.

Decorates the result of [[immutant.web.async/as-channel]] with the proper SSE Content-Type.
sourceraw docstring

Eventcljprotocol

event->strclj

(event->str x)

Formats event according to SSE spec

Formats event according to SSE spec
source

send!clj

(send! ch event & options)

Formats an event according to the SSE spec and sends it via immutant.web.async/send!.

event can be one of:

  • a Map, with one or more of the following keys: :event, :data, :id, and :retry, where the :data entry can be an Object or Collection
  • an Object, treated as a simple data field (sent as (str "data:" the-object "\n"))
  • a Collecton, treated as a multi-line data field

The options for this function are the same as the options for immutant.web.async/send!.

If you need different behavior for a particular type, extend it with the Event protocol.

Formats an event according to the SSE spec and sends it via [[immutant.web.async/send!]].

`event` can be one of:

* a Map, with one or more of the following keys: :event, :data, :id, and
  :retry, where the :data entry can be an Object or Collection
* an Object, treated as a simple data field (sent as
  `(str "data:" the-object "\n")`)
* a Collecton, treated as a multi-line data field

The options for this function are the same as the options
for [[immutant.web.async/send!]].

If you need different behavior for a particular type, extend it with
the [[Event]] protocol.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close