Exposes subscriptions to the index as server sent event channels


Prepare an event for sending out on the wire.


(http-query-map string)

Converts a URL query string into a map.


(sse-error-uri ch uri)

Dummy 404 output for invalid URIs


(sse-handler core stats headers)

Queries the index for events and streams them to the client, also initiates a pubsub subscription to the index topic with that query.


(sse-out {:keys [out], :as stats} ch pred)

Yield a function that given an incoming event will test for a given predicate and when it matches will format it for sending it over a SSE channel.


(sse-server)(sse-server {:keys [host port headers], :or {host "", port 5558, headers {}}})

Creates a new SSE server for a core.


  • :host The address to listen on (default
  • :port The port to listen on (default 5558)
  • :headers Additional headers to send with the reply. By default Content-Type is set to text/event-stream and Cache-Control to no-cache. If you do not expose your client web application behind the same host, you will probably need to add an Access-Control-Allow-Origin header here