HTTP.EventSource (http_event_source v0.13.0)
View SourceBrowser-like EventSource client API for Elixir.
Events are delivered as messages to the owner process:
{HTTP.EventSource, source, %HTTP.EventSource.Event.Open{}}
{HTTP.EventSource, source, %HTTP.EventSource.Event.Message{}}
{HTTP.EventSource, source, %HTTP.EventSource.Event.Error{}}Custom server-sent event names are delivered through the message event's
type field.
For https connections, pass tls_backend: :ssl | :ex_ssl (or the equivalent
string in a map). When omitted, the shared :http_core TLS backend setting is
captured when the source is created and retained across reconnects.
Summary
Types
Functions
@spec close(t()) :: :ok
@spec closed() :: 2
@spec connecting() :: 0
@spec open() :: 1
@spec ready_state(t()) :: 0 | 1 | 2
@spec reconnect_time(t()) :: non_neg_integer()