Backplane.AiProtocol.SSE (backplane_ai_protocol v0.7.0)

Copy Markdown

Bounded incremental Server-Sent Events framing.

Summary

Types

event()

@type event() :: %{event: String.t() | nil, data: String.t()}

t()

@type t() :: %Backplane.AiProtocol.SSE{
  buffer: term(),
  closed?: term(),
  max_buffer_bytes: term(),
  max_frame_bytes: term()
}

Functions

feed(state, chunk)

@spec feed(t(), binary()) ::
  {:ok, t(), [event()]} | {:error, Backplane.AiProtocol.Error.t(), t()}

finish(state)

@spec finish(t()) ::
  {:ok, t(), [event()]} | {:error, Backplane.AiProtocol.Error.t(), t()}

new(opts \\ [])

@spec new(keyword()) :: t()