MingaEditor.Supervisor (Minga v0.1.0)

Copy Markdown View Source

Supervises the editor runtime: parser, renderer server, and Editor GenServer.

Uses rest_for_one to enforce the dependency chain:

MingaEditor.Supervisor (rest_for_one)
 Minga.Parser.Manager            Tree-sitter parser Port
 MingaEditor.Frontend.Manager    Zig/Metal frontend Port
 MingaEditor.Renderer.Server     Async render pipeline
 MingaEditor                     Editor orchestration GenServer

If Parser.Manager crashes, everything below restarts. If Frontend.Manager crashes, Renderer.Server and Editor restart. If Renderer.Server crashes, Editor restarts (it holds a resolved pid that would be stale). An Editor crash restarts only the Editor.

This supervisor is conditionally started: it only appears in the supervision tree when the editor UI is active (not in test mode or headless operation).

Summary

Types

Options for starting the editor supervisor.

Functions

Returns a specification to start this module under a supervisor.

Types

start_opt()

@type start_opt() ::
  {:name, GenServer.name()} | {:backend, MingaEditor.Frontend.Manager.backend()}

Options for starting the editor supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

@spec start_link([start_opt()]) :: Supervisor.on_start()