January 2018
Intermediate to advanced
336 pages
7h 56m
English
An interceptor for SSE can be created using the start-event-stream (http://pedestal.io/api/pedestal.service/io.pedestal.http.sse.html#var-start-event-stream) function provided by the Pedestal service component. It takes a function as input and returns an interceptor. The function expected by the start-event-stream function is called by Pedestal once the initial HTTP connection is established with the client; the HTTP response is prepared and Pedestal notifies the client that an SSE stream is starting. It takes a channel as input (https://clojure.github.io/core.async/), and Context Map. To send the events to the client, the function just publishes them on the channel provided as an argument to the function. In ...
Read now
Unlock full access