Raxol.Core.Runtime.Plugins.Manager (Raxol v0.5.0)

View Source

Manages the loading, initialization, and lifecycle of plugins in the Raxol runtime.

This module is responsible for:

  • Discovering available plugins
  • Loading and initializing plugins
  • Managing plugin lifecycle events
  • Providing access to loaded plugins
  • Handling plugin dependencies and conflicts
  • Optionally watching plugin source files for changes and reloading them (dev only).

Summary

Functions

Returns a specification to start this module under a supervisor.

Disable a plugin temporarily without unloading it.

Enable a plugin that was previously disabled.

Get a specific plugin by its ID.

Gets a plugin's current state.

Initialize the plugin system and load all available plugins.

Get a list of all loaded plugins with their metadata.

Loads a plugin by sending a call to the GenServer.

Loads a plugin with the given name and configuration.

Reload a plugin by unloading and then loading it again.

Sets a plugin's state directly.

Unloads a plugin by sending a call to the GenServer.

Updates a plugin's state using a function.

Types

plugin_id()

@type plugin_id() :: String.t()

plugin_metadata()

@type plugin_metadata() :: map()

plugin_state()

@type plugin_state() :: map()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disable_plugin(plugin_id)

Disable a plugin temporarily without unloading it.

enable_plugin(plugin_id)

Enable a plugin that was previously disabled.

get_plugin(plugin_id)

Get a specific plugin by its ID.

get_plugin_state(plugin_id)

Gets a plugin's current state.

handle_cleanup(context)

handle_error(error, context)

initialize()

Initialize the plugin system and load all available plugins.

list_plugins()

Get a list of all loaded plugins with their metadata.

load_plugin(plugin_id)

Loads a plugin by sending a call to the GenServer.

load_plugin(name, config)

@spec load_plugin(String.t(), map()) :: {:ok, map()} | {:error, String.t()}

Loads a plugin with the given name and configuration.

reload_plugin(plugin_id)

Reload a plugin by unloading and then loading it again.

set_plugin_state(plugin_id, new_state)

Sets a plugin's state directly.

unload_plugin(plugin_id)

Unloads a plugin by sending a call to the GenServer.

update_plugin(plugin_id, update_fun)

Updates a plugin's state using a function.