ServerSentEventStage (ServerSentEventStage v1.2.1) 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 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.
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.
Optional arguments:
headers
: a list of{"name", "value"}
pairsidle_timeout
: milliseconds of inactivity after which the connection will be restarteddebug
,name
,timeout
,spawn_opt
: options forGenStage.start_link/3