Raxol.Core.Runtime.Plugins.LifecycleHelper (Raxol v0.2.0)
View SourceHandles plugin lifecycle operations (loading, unloading, reloading) for the Plugin Manager.
Summary
Functions
Checks if all dependencies for a plugin are met by the currently loaded plugins.
Returns :ok
or {:error, :missing_dependencies, missing_list}
.
Discovers, sorts, and loads all plugins from the default directory.
Loads a plugin by its ID (string) or module (atom).
Loads plugin configuration (placeholder).
Reloads a plugin identified by its ID.
Sorts a list of plugin modules based on their declared dependencies.
Unloads a plugin identified by its ID.
Functions
Checks if all dependencies for a plugin are met by the currently loaded plugins.
Returns :ok
or {:error, :missing_dependencies, missing_list}
.
Discovers, sorts, and loads all plugins from the default directory.
Accepts the initial Manager state maps and returns the updated maps (including plugin_paths
) after loading,
or an error tuple if discovery, sorting, or loading fails.
Returns {:ok, %{...updated_maps..., plugin_paths: map()}} | {:error, reason}
Loads a plugin by its ID (string) or module (atom).
Accepts the current plugin state maps and config, returns updated maps or an error.
Returns {:ok, %{plugins: map(), metadata: map(), plugin_states: map(), load_order: list(), plugin_config: map()}} | {:error, reason}
.
Loads plugin configuration (placeholder).
Reloads a plugin identified by its ID.
Handles unloading and then loading again, potentially with code reloading.
Accepts the current plugin state maps and config, returns updated maps or an error.
Requires the plugin_paths
map to find the source file.
Returns {:ok, %{...updated_maps...}} | {:error, reason}
.
Sorts a list of plugin modules based on their declared dependencies.
Accepts a list of {plugin_module, plugin_metadata}
tuples.
Returns {:ok, sorted_plugin_modules}
or {:error, :circular_dependency, cycle}
.
Uses a topological sort algorithm.
Unloads a plugin identified by its ID.
Accepts the current plugin state maps, returns updated maps or an error.
Returns {:ok, %{plugins: map(), metadata: map(), plugin_states: map(), load_order: list()}} | {:error, reason}
.