An event encoded with the SSE protocol..
Makes a Flow[E, Event, _]
, given an input source.
Makes a Flow[E, Event, _]
, given an input source.
Usage example:
val jsonStream: Source[JsValue, Unit] = createJsonSource() Ok.chunked(jsonStream via EventSource.flow).as(ContentTypes.EVENT_STREAM)
This class provides an easy way to use Server Sent Events (SSE) as a chunked encoding, using an Akka Source.
Please see the Server-Sent Events specification for details.
An example of how to display an event stream: