Raxol.Core.Runtime.Lifecycle (Raxol v0.2.0)
View SourceManages the application lifecycle, including startup, shutdown, and terminal interaction.
Summary
Functions
Cleans up resources when an application is shutting down.
Handles errors during application execution.
Initializes the appropriate environment (TTY or VS Code) based on the runtime options.
Looks up an application by name.
Registers an application with the registry.
Starts a Raxol application with the given module and options.
Stops a running application.
Functions
Cleans up resources when an application is shutting down.
Handles errors during application execution.
Logs the error and attempts to recover if possible.
Initializes the appropriate environment (TTY or VS Code) based on the runtime options.
Looks up an application by name.
Returns {:ok, pid}
if the application is found, :error
otherwise.
Registers an application with the registry.
Starts a Raxol application with the given module and options.
Options
:title
- The window title (default: "Raxol Application"):fps
- Frames per second (default: 60):quit_keys
- List of keys that will quit the application (default: [:ctrl_c]):debug
- Enable debug mode (default: false):width
- Terminal width (default: 80):height
- Terminal height (default: 24)
Stops a running application.
Returns :ok
if the application was stopped successfully,
{:error, :app_not_running}
if the application is not running.