Supervised owner of the SSE session table used by ExMCP.HttpPlug.
ExMCP.HttpPlug runs inside short-lived HTTP request processes, so the ETS
table mapping session ids to SSE handler pids must be owned by a long-lived
process — otherwise every registration would vanish as soon as the request
process that happened to create the table exits. This GenServer creates the
named public table in init/1 and simply holds it for the lifetime of the
:ex_mcp application, which starts it as part of its supervision tree.
Summary
Functions
Returns a specification to start this module under a supervisor.
Looks up the SSE handler pid registered for a session id.
Registers the SSE handler pid for a session id.
Returns the name of the ETS table holding session registrations.
Removes the registration for a session id.
Removes the registration for a session id only if it still points at
handler_pid.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Looks up the SSE handler pid registered for a session id.
Registers the SSE handler pid for a session id.
Returns {:error, :registry_not_started} when the owning process (and thus
the table) is not running, which usually means the :ex_mcp application has
not been started.
@spec start_link(keyword()) :: GenServer.on_start()
@spec table() :: atom()
Returns the name of the ETS table holding session registrations.
@spec unregister(String.t()) :: :ok
Removes the registration for a session id.
Removes the registration for a session id only if it still points at
handler_pid.
Used by handlers cleaning up after themselves in terminate/2 without
clobbering a newer registration made for the same session id.