Raxol.Application (Raxol v2.0.1)
View SourceMain application module for Raxol terminal emulator.
Handles application startup, supervision tree initialization, core system configuration, and runtime feature management.
Environment-based Configuration
The application adapts its behavior based on the environment:
:test- Minimal supervision tree for testing:minimal- Ultra-fast startup with core features only:dev- Full feature set with development tools:prod- Production configuration with optimizations
Feature Flags
Features can be enabled/disabled via configuration:
config :raxol, :features,
web_interface: true,
terminal_driver: true,
plugins: false,
telemetry: trueHealth Monitoring
The application includes built-in health checks:
- Supervision tree health
- Memory usage monitoring
- Process count tracking
- Telemetry event monitoring
Summary
Functions
Dynamically add a child to the supervision tree.
Get current application health status.
Dynamically remove a child from the supervision tree.
Toggle a feature flag at runtime. Some features require application restart to take effect.
Types
@type child_spec() :: Supervisor.child_spec() | {module(), term()} | module()
@type feature_flag() :: atom()
@type start_mode() :: :full | :minimal | :custom
Functions
@spec add_child(child_spec()) :: {:ok, pid()} | {:error, term()}
Dynamically add a child to the supervision tree.
@spec health_status() :: %{ mode: atom(), supervisor_alive: boolean(), children: non_neg_integer(), memory_mb: non_neg_integer(), process_count: non_neg_integer(), features: map(), uptime_seconds: integer() }
Get current application health status.
Dynamically remove a child from the supervision tree.
@spec toggle_feature(feature_flag(), boolean()) :: :ok | {:error, :restart_required}
Toggle a feature flag at runtime. Some features require application restart to take effect.