Class: Legion::TTY::Background::BootstrapConfig
- Inherits:
-
Object
- Object
- Legion::TTY::Background::BootstrapConfig
- Defined in:
- lib/legion/tty/background/bootstrap_config.rb
Constant Summary collapse
- ENV_KEY =
'LEGIONIO_BOOTSTRAP_CONFIG'- SETTINGS_DIR =
File.('~/.legionio/settings')
Instance Method Summary collapse
-
#initialize(logger: nil) ⇒ BootstrapConfig
constructor
A new instance of BootstrapConfig.
- #run_async(queue) ⇒ Object
Constructor Details
#initialize(logger: nil) ⇒ BootstrapConfig
Returns a new instance of BootstrapConfig.
16 17 18 |
# File 'lib/legion/tty/background/bootstrap_config.rb', line 16 def initialize(logger: nil) @log = logger end |
Instance Method Details
#run_async(queue) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/legion/tty/background/bootstrap_config.rb', line 20 def run_async(queue) Thread.new do result = perform_bootstrap queue.push(result) rescue StandardError => e @log&.log('bootstrap', "ERROR: #{e.class}: #{e.}") queue.push({ type: :bootstrap_error, error: e. }) end end |