SSE has a retry field, but that doesn't seem to be supportet in io.pedestal.http.sse. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#retry
This looks like something that should be handled correctly. Please add an issue for tracking purposed.
something like this maybe?
(def ^:private RETRY_FIELD (get-bytes "retry: "))
(defn- event->bytes
[name data id retry]
(let [bab (ByteArrayBuilder.)]
(when name
(.write bab ^bytes EVENT_FIELD)
(.write bab ^bytes (get-bytes name))
(.write bab ^bytes EOL))
(when data
(doseq [part (string/split-lines data)]
(.write bab ^bytes DATA_FIELD)
(.write bab ^bytes (get-bytes part))
(.write bab ^bytes EOL)))
(when id
(.write bab ^bytes ID_FIELD)
(.write bab ^bytes (get-bytes id))
(.write bab ^bytes EOL))
(when retry
(.write bab ^bytes RETRY_FIELD)
(.write bab ^bytes (get-bytes (str retry)))
(.write bab ^bytes EOL))
(.write bab ^bytes EOL)
(.toByteArray bab)))code currently doesn't check that anything other than EOL is actually written to the buffer (since I make data optional here)