Tinkex.Streaming.ServerSentEvent (Tinkex v0.3.4)

View Source

Representation of a server-sent event.

Summary

Functions

Decode the event data as JSON if possible; otherwise return the raw string.

Types

t()

@type t() :: %Tinkex.Streaming.ServerSentEvent{
  data: String.t(),
  event: String.t() | nil,
  id: String.t() | nil,
  retry: non_neg_integer() | nil
}

Functions

json(server_sent_event)

@spec json(t()) :: term()

Decode the event data as JSON if possible; otherwise return the raw string.