Liking cljdoc? Tell your friends :D

io.pedestal.http.sse


COMMENT_FIELDclj

source

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
sourceraw docstring

CRLFclj

source

daemon-thread-factoryclj

source

DATA_FIELDclj

source

do-heartbeatclj

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

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.
sourceraw docstring

EVENT_FIELDclj

source

get-bytesclj

(get-bytes s)
source

ID_FIELDclj

source

mk-dataclj

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

schedulerclj

source

send-eventclj

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

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.
sourceraw 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.
sourceraw 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.
sourceraw docstring

UTF-8clj

source

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

× close