DynamicSupervisor managing extension process trees.
Each extension gets its own child under this supervisor. If an extension crashes, only that extension restarts. The editor and other extensions are unaffected.
Lifecycle
- Config eval registers extensions in
Extension.Registry start_all/0reads the registry and starts each extensionstop_all/0terminates all running extensions (used by reload)
Summary
Types
Options for extension start/stop that inject collaborator dependencies.
Functions
Returns a specification to start this module under a supervisor.
Returns a summary of all extensions: [{name, version, status}].
Starts all extensions declared in the registry.
Starts a single extension by name.
Starts the extension supervisor.
Stops all running extensions and purges their modules.
Stops a single extension, terminates its process, and purges the module.
Types
@type start_opts() :: [ command_registry: GenServer.server(), keymap: GenServer.server() ]
Options for extension start/stop that inject collaborator dependencies.
:command_registry— theMinga.Command.Registryserver to register commands with (default:Minga.Command.Registry):keymap— theMinga.Keymap.Activeserver to register keybindings with (default:Minga.Keymap.Active)
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec list_extensions() :: [{atom(), String.t(), Minga.Extension.extension_status()}]
Returns a summary of all extensions: [{name, version, status}].
@spec list_extensions(GenServer.server()) :: [ {atom(), String.t(), Minga.Extension.extension_status()} ]
@spec start_all() :: :ok
Starts all extensions declared in the registry.
Processes extensions in order:
- Install all hex extensions via a single Mix.install/2 call
- Clone/checkout all git extensions to local cache
- Compile and start all extensions (path, git, hex)
Errors at any stage are logged to Messages and stored in the
registry as :load_error without affecting other extensions.
@spec start_all(GenServer.server(), GenServer.server()) :: :ok
@spec start_extension( GenServer.server(), GenServer.server(), atom(), Minga.Extension.Registry.entry(), start_opts() ) :: {:ok, pid()} | {:error, term()}
Starts a single extension by name.
For path extensions, compiles the module from the local directory. Git and hex extensions must be resolved to a local path or loaded via Mix.install before calling this function.
@spec start_link(keyword()) :: Supervisor.on_start()
Starts the extension supervisor.
@spec stop_all() :: :ok
Stops all running extensions and purges their modules.
Used by config reload to cleanly tear down before re-loading.
@spec stop_all(GenServer.server(), GenServer.server()) :: :ok
@spec stop_extension( GenServer.server(), GenServer.server(), atom(), Minga.Extension.Registry.entry(), start_opts() ) :: :ok
Stops a single extension, terminates its process, and purges the module.