Provides Server-Sent Events via immutant.web.async/as-channel
Provides Server-Sent Events via [[immutant.web.async/as-channel]]
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.
(event->str x)
Formats event according to SSE spec
Formats event according to SSE spec
(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:
(str "data:" the-object "\n")
)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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close