Noizu.MCP.Server.EventStore (Noizu MCP v0.1.3)

Copy Markdown View Source

Buffer for Streamable HTTP messages that had no live stream to deliver to, enabling SSE resumability via Last-Event-ID.

The default implementation is a bounded per-session ETS ring buffer owned by the server's supervision tree (node-local — multi-node deployments need sticky sessions or a custom store).

Summary

Functions

Append a message; returns its event id.

Returns a specification to start this module under a supervisor.

Drop a session's buffered events (e.g. on session termination).

All buffered {event_id, binary} for a session after last_event_id (nil = all).

Types

event_id()

@type event_id() :: String.t()

Functions

append(server, session_id, binary)

@spec append(module(), String.t(), binary()) :: event_id()

Append a message; returns its event id.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

drop(server, session_id)

@spec drop(module(), String.t()) :: :ok

Drop a session's buffered events (e.g. on session termination).

replay_after(server, session_id, last_event_id)

@spec replay_after(module(), String.t(), event_id() | nil) :: [{event_id(), binary()}]

All buffered {event_id, binary} for a session after last_event_id (nil = all).

start_link(server)