Liking cljdoc? Tell your friends :D

io.pedestal.http.sse


COMMENT_FIELDclj


counted-thread-factoryclj

(counted-thread-factory name-format daemon)

Create a ThreadFactory that maintains a counter for naming Threads. name-format specifies thread names - use %d to include counter daemon is a flag for whether threads are daemons or not

Create a ThreadFactory that maintains a counter for naming Threads.
name-format specifies thread names - use %d to include counter
daemon is a flag for whether threads are daemons or not
raw docstring

CRLFclj


daemon-thread-factoryclj


DATA_FIELDclj


do-heartbeatclj

(do-heartbeat channel)
(do-heartbeat channel {:keys [on-client-disconnect]})

end-event-streamcljdeprecated

(end-event-stream {end-fn :io.pedestal.http.sse/end-event-stream})

DEPRECATED. Given a context, clean up the event stream it represents.

DEPRECATED. Given a `context`, clean up the event stream it represents.
raw docstring

EVENT_FIELDclj


get-bytesclj

(get-bytes s)

ID_FIELDclj


mk-dataclj

(mk-data name data)
(mk-data name data id)

schedulerclj


send-eventclj

(send-event channel name data)
(send-event channel name data id)
(send-event channel name data id put-fn)

sse-setupclj

(sse-setup & args)

See start-event-stream. This function is for backward compatibility.

See start-event-stream. This function is for backward compatibility.
raw docstring

start-event-streamclj

(start-event-stream stream-ready-fn)
(start-event-stream stream-ready-fn heartbeat-delay)
(start-event-stream stream-ready-fn heartbeat-delay bufferfn-or-n)
(start-event-stream stream-ready-fn heartbeat-delay bufferfn-or-n opts)

Returns an interceptor which will start a Server Sent Event stream with the requesting client, and set the ServletResponse to go async. After the request handling context has been paused in the Servlet thread, stream-ready-fn will be called in a future, with the resulting context from setting up the SSE event stream.

opts is a map with optional keys:

:on-client-disconnect - A function of one argument which will be called when the client permanently disconnects.

Returns an interceptor which will start a Server Sent Event stream
with the requesting client, and set the ServletResponse to go
async. After the request handling context has been paused in the
Servlet thread, `stream-ready-fn` will be called in a future, with
the resulting context from setting up the SSE event stream.

opts is a map with optional keys:

:on-client-disconnect - A function of one argument which will be
  called when the client permanently disconnects.
raw docstring

start-streamclj

(start-stream stream-ready-fn context heartbeat-delay)
(start-stream stream-ready-fn context heartbeat-delay bufferfn-or-n)
(start-stream stream-ready-fn context heartbeat-delay bufferfn-or-n opts)

Starts an SSE event stream and initiates a heartbeat to keep the connection alive. stream-ready-fn will be called with a core.async channel. The application can then put maps with keys :name and :data on that channel to cause SSE events to be sent to the client. Either the client or the application may close the channel to terminate and clean up the event stream; the client closes it by closing the connection.

The SSE's core.async buffer can either be a fixed buffer (n) or a 0-arity function that returns a buffer.

Starts an SSE event stream and initiates a heartbeat to keep the
connection alive. `stream-ready-fn` will be called with a core.async
channel. The application can then put maps with keys :name and :data
on that channel to cause SSE events to be sent to the client. Either
the client or the application may close the channel to terminate and
clean up the event stream; the client closes it by closing the
connection.

The SSE's core.async buffer can either be a fixed buffer (n) or a 0-arity
function that returns a buffer.
raw docstring

UTF-8clj

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

× close