ServerSentEventStage v0.4.1 ServerSentEventStage View Source
A GenStage producer which parses the ServerSentEvent (SSE) protocol.
SSEs are used in browsers via the EventSource API, but they can be used for any kind of one-directional streaming.
For more information, see the W3C.
Link to this section Summary
Functions
Refresh the connection by disconnecting and reconnecting.
Starts a producer stage which parse the ServerSentEvent protocol and send those messages as events.
Link to this section Functions
refresh(server) View Source
Refresh the connection by disconnecting and reconnecting.
Some clients will send a final message, but not terminate the connection=. This function allows a client of SSES to reconnect.
start_link(args) View Source
Starts a producer stage which parse the ServerSentEvent protocol and send those messages as events.
The only required argument is url
: it can be either a binary of the URL
to connect to or a {module, fun, arguments} tuple.
Other arguments are passed as options to GenStage.start_link/3
.