Raxol.Plugins.HotReloadManager (Raxol v2.0.1)

View Source

Advanced hot-reload system for Plugin System v2.0.

Features:

  • Intelligent code change detection
  • State preservation during reloads
  • Dependency-aware reloading
  • Rollback on failure
  • Development-friendly hot-swapping
  • Production-safe reload strategies

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns default hot-reload options for development.

Disables hot-reload for a plugin.

Enables hot-reload for a plugin with specified options.

Gets reload history for debugging.

Gets hot-reload status for a plugin.

Lists all plugins with hot-reload enabled.

Returns conservative hot-reload options for production.

Manually triggers a hot-reload for a plugin.

Rolls back a plugin to its previous state.

Types

file_change()

@type file_change() :: %{
  path: String.t(),
  type: :created | :modified | :deleted,
  plugin_id: plugin_id(),
  timestamp: DateTime.t()
}

plugin_id()

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

reload_options()

@type reload_options() :: %{
  strategy: reload_strategy(),
  preserve_state: boolean(),
  backup_enabled: boolean(),
  dependency_handling: :ignore | :reload_dependents | :block_if_dependents,
  timeout_ms: non_neg_integer()
}

reload_strategy()

@type reload_strategy() :: :hot_swap | :graceful_restart | :dependency_cascade

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

development_options()

Returns default hot-reload options for development.

disable_hot_reload(plugin_id)

Disables hot-reload for a plugin.

enable_hot_reload(plugin_id, plugin_path, opts \\ %{})

Enables hot-reload for a plugin with specified options.

get_reload_history(plugin_id \\ nil)

Gets reload history for debugging.

get_reload_status(plugin_id)

Gets hot-reload status for a plugin.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

list_watched_plugins()

Lists all plugins with hot-reload enabled.

production_options()

Returns conservative hot-reload options for production.

reload_plugin(plugin_id, opts \\ %{})

Manually triggers a hot-reload for a plugin.

rollback_plugin(plugin_id)

Rolls back a plugin to its previous state.

start_link(init_opts \\ [])