Raxol.Core.Runtime.Lifecycle
(Raxol v2.3.0)
View Source
Manages the application lifecycle, including startup, shutdown, and terminal interaction.
Orchestrates initialization of subsystems in order:
- PluginManager -- loads and starts plugins
- Dispatcher -- manages app model and event routing (TEA update/2 loop)
- Terminal Driver -- raw terminal I/O (skipped for :liveview/:ssh environments)
- Rendering Engine -- view -> layout -> buffer -> output pipeline
Uses a two-phase readiness pattern: rendering begins only after both
dispatcher_ready and plugin_manager_ready flags are set. In dev mode,
a CodeReloader is started to watch for source changes and trigger re-renders.
Sub-modules
Lifecycle.Initializer-- component startup sequenceLifecycle.Shutdown-- stop_process, cleanup, registry management
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the application name for a given module.
Initializes the runtime environment. (Stub for test compatibility)
Looks up a registered app by ID.
Starts a Raxol application (compatibility wrapper).
Starts and links a new Raxol application lifecycle manager.
Stops the Raxol application lifecycle manager.
Stops a Raxol application (compatibility wrapper).
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Gets the application name for a given module.
@spec handle_cleanup(map()) :: :ok | {:error, :cleanup_failed}
Initializes the runtime environment. (Stub for test compatibility)
Looks up a registered app by ID.
@spec start_application( module(), keyword() ) :: GenServer.on_start()
Starts a Raxol application (compatibility wrapper).
Starts and links a new Raxol application lifecycle manager.
Options
:app_module- Required application module atom.:name- Optional name for registering the GenServer.:width- Terminal width (default: 80).:height- Terminal height (default: 24).:debug- Enable debug mode (default: false).:initial_commands- A list ofRaxol.Core.Runtime.Commandstructs to execute on startup.:plugin_manager_opts- Options to pass to the PluginManager's start_link function.
Stops the Raxol application lifecycle manager.
@spec stop_application(GenServer.server()) :: :ok
Stops a Raxol application (compatibility wrapper).
@spec terminate_manager(term(), %Raxol.Core.Runtime.Lifecycle.State{ app_module: term(), app_name: term(), code_reloader_pid: term(), command_registry_table: term(), cycle_profiler_pid: term(), debug_mode: term(), dispatcher_pid: term(), dispatcher_ready: term(), driver_pid: term(), height: term(), initial_commands: term(), model: term(), options: term(), plugin_manager: term(), plugin_manager_ready: term(), rendering_engine_pid: term(), time_travel_pid: term(), width: term() }) :: :ok