Module: Lich::Common::SessionLauncher
- Defined in:
- documented/common/session_launcher.rb
Overview
Launches independent child Lich sessions using prepared launch_data mapped to CLI-style argv.
Constant Summary collapse
- OPTIONAL_PATH_FLAGS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Configuration for optional directory path CLI flags that may be passed to child launches. Each entry maps a CLI option name to a context key, launcher constant name, and priority. Used by optional_spawn_flags to emit --home, --data, --scripts, etc. flags only when the child process directory would differ from defaults.
[ { option: 'home', key: :home_dir, constant: :LICH_DIR }, { option: 'data', key: :data_dir, constant: :DATA_DIR }, { option: 'scripts', key: :script_dir, constant: :SCRIPT_DIR }, { option: 'temp', key: :temp_dir, constant: :TEMP_DIR }, { option: 'maps', key: :map_dir, constant: :MAP_DIR }, { option: 'logs', key: :log_dir, constant: :LOG_DIR }, { option: 'backup', key: :backup_dir, constant: :BACKUP_DIR }, { option: 'lib', key: :lib_dir, constant: :LIB_DIR } ].freeze
Class Method Summary collapse
-
.launch(launch_data, launch_context: nil) ⇒ Hash
Launches a detached child Lich process from prebuilt launch data.
Class Method Details
.launch(launch_data, launch_context: nil) ⇒ Hash
Launches a detached child Lich process from prebuilt launch data.
42 43 44 45 46 47 48 49 50 51 |
# File 'documented/common/session_launcher.rb', line 42 def launch(launch_data, launch_context: nil) unless launch_data.is_a?(Array) && launch_data.any? return { ok: false, error: 'launch_data must be a non-empty Array' } end pid = spawn_process(launch_data, launch_context: launch_context) { ok: true, pid: pid } rescue StandardError => e { ok: false, error: e. } end |