GenServer that supervises a single llama-server OS process.
The OS process itself is owned by Arrea.LongRunning, which gives us
for free:
- Registration in
Arrea.Registryunder{:candil_engine, model.alias}so other apps canArrea.LongRunning.state(id)/health(id)/stop(id)without going through Candil. - Telemetry events on
[:arrea, :long_running, ...]for started / stopped / crashed / data. - Automatic port cleanup on crash (Arrea links the port and the GenServer; if the binary dies, Arrea dies, and the link cascade kills this GenServer too).
- Crash isolation via
Arrea.WorkerSupervisor's:one_for_onestrategy.
What this GenServer keeps:
- The Candil-side
Candil.Registryregistration under the model alias (soCandil.Engine.stop/1,healthy?/1,base_url/1keep working through the existing API). - A cached
healthyboolean refreshed by a 5s/healthpoll (informational; Arrea also runs the probe for telemetry). - The
terminate/2cleanup that callsArrea.LongRunning.stop/1explicitly when Candil stops the engine normally.
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
@type state() :: %{ engine: Candil.Engine.t(), model: Candil.Model.t(), base_url: binary(), lr_pid: pid(), healthy: boolean() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.