ReqManagedAgents.Host.SessionSupervisor (req_managed_agents_host v0.1.0)

Copy Markdown View Source

DynamicSupervisor holding one live SessionServer per external id. Crash-isolated: killing one server never affects a sibling. start_or_get/2 is the sole entry point — it starts a fresh server or hands back the pid of one already registered under the same external id, resolving the race where two callers both call it concurrently for the same id.

Summary

Functions

Start (or fetch, if a race lost) the SessionServer for external_id.

Functions

start_or_get(external_id, config)

@spec start_or_get(String.t(), ReqManagedAgents.Host.Config.t()) ::
  {:ok, pid()} | {:error, term()}

Start (or fetch, if a race lost) the SessionServer for external_id.