Anubis. Server. Transport. StreamableHTTP. EventStore. InMemory
(anubis_mcp v1.14.0)
Copy Markdown
In-memory Anubis.Server.Transport.StreamableHTTP.EventStore adapter backed by
a single GenServer.
Each session keeps a bounded ring of the most recent {event_id, data} pairs.
Event ids are drawn from a single store-wide monotonic counter, so they never
restart at 1 for a session that was evicted and later reappears — a
reconnect carrying an old higher Last-Event-ID therefore never filters out
genuinely newer events. This is the default adapter and is suitable for
single-node HTTP deployments: it makes short reconnect gaps seamless without
any external dependency.
Bounds
:history_size— events retained per session (default100). Older events are evicted; a client whoseLast-Event-IDpredates the ring recovers only the events still held (see theEventStorebehaviour on gaps).:max_sessions— sessions retained before the least-recently-appended one is evicted (default1_000, or:infinityto disable). This bounds memory for servers that churn sessions without an explicitDELETE. Sessions are also dropped promptly ondelete/2. Because ids come from the store-wide counter, an evicted session that reappends resumes with strictly larger ids.
Events are lost on process restart. Recovery across restarts is a host-level concern (e.g. a durable journal), by design: the transport ring exists to make live reconnects seamless, not to be a system of record.
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts the in-memory event store.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the in-memory event store.
Options
:name— registered process name (required):history_size— events retained per session (default100):max_sessions— sessions retained before LRU eviction, or:infinity(default1000)