H.Session.Supervisor (H v0.3.0)

Copy Markdown View Source

Per-session :one_for_all supervision boundary (Task.Supervisor + H.Session.Server).

Started under DynamicSupervisor with restart: :temporary so a failing session never consumes the shared DynamicSupervisor restart budget or cascades across healthy sessions. Exceeding the internal restart budget (max_restarts: 2, max_seconds: 5) or hitting an unrecoverable storage error quarantines the session in H.Catalog and stops cleanly.

Summary

Functions

Returns a :temporary supervisor child spec for DynamicSupervisor.

Starts the per-session supervisor wrapper.

Cleanly stops and unloads the per-session supervisor and its children from RAM without quarantining the session in H.Catalog.

Functions

child_spec(init_arg)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Returns a :temporary supervisor child spec for DynamicSupervisor.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the per-session supervisor wrapper.

stop_session(registry, runtime_sup, session_id)

@spec stop_session(atom(), Supervisor.supervisor(), String.t()) :: :ok

Cleanly stops and unloads the per-session supervisor and its children from RAM without quarantining the session in H.Catalog.