(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
(do-heartbeat channel)
(do-heartbeat channel {:keys [on-client-disconnect]})
(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.
(get-bytes s)
(mk-data name data)
(mk-data name data id)
(send-event channel name data)
(send-event channel name data id)
(send-event channel name data id put-fn)
(sse-setup & args)
See start-event-stream. This function is for backward compatibility.
See start-event-stream. This function is for backward compatibility.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close