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)
Makes an Enumeratee[E, Event]
, that is an iteratee.Enumeratee transforming E
values
into Event values.
Makes an Enumeratee[E, Event]
, that is an iteratee.Enumeratee transforming E
values
into Event values.
Usage example:
val someDataStream: Enumerator[SomeData] = ???
Ok.chunked(someDataStream &> EventSource())
from type of the Enumeratee
(Since version 2.5.0) Use apply with an Akka source instead
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: