One GenServer per tracked compute resource.
Responsibilities:
- Hold the resource's normalized
ExAtlas.Spec.Compute, its:user_id,:idle_ttl_ms, last-activity timestamp, and spawn opts. - Trap exits so
terminate/2always callsExAtlas.terminate/2on the upstream provider — even on supervisor shutdown or crash. - Drive its own idle reaper via the GenServer
timeout:reply element: every message resets the timeout; hitting it stops the server normally and terminates the upstream resource. - Broadcast state changes over
Phoenix.PubSubviaExAtlas.Orchestrator.Events.
Per project conventions, callback bodies never wrap logic in try/rescue —
if a provider API raises, we let the server crash and the supervisor
handles restart policy. The terminate/2 callback handles upstream teardown.
Summary
Functions
Returns a specification to start this module under a supervisor.
Return the current tracked state.
Bump last-activity so the idle reaper waits another idle_ttl_ms.
Types
@type state() :: %{ compute: ExAtlas.Spec.Compute.t(), opts: keyword(), idle_ttl_ms: pos_integer(), heartbeat_ms: pos_integer(), last_activity_ms: integer(), user_id: term() | nil }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Return the current tracked state.
Bump last-activity so the idle reaper waits another idle_ttl_ms.