Raxol. Core. Runtime. Lifecycle
(Raxol v2.6.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 of directive structs to execute on startup.:plugin_manager_opts- Options to pass to the PluginManager's start_link function.:adaptive- Enable adaptive UI (layout recommendations from behavior tracking). Default: false.:alternate_screen- Enter the alternate screen buffer on startup (DECSET 1049). Prevents TUI frames from polluting the client's scrollback. Default: false.
Stops the Raxol application lifecycle manager.
@spec stop_application(GenServer.server()) :: :ok
Stops a Raxol application (compatibility wrapper).