Class: Falcon::Command::Host
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Falcon::Command::Host
- Includes:
- Paths
- Defined in:
- lib/falcon/command/host.rb
Overview
Implements the falcon host command. Designed for deployment.
Manages a Controller::Host instance which is responsible for running applications in a production environment.
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
One or more paths to the configuration files.
Class Method Summary collapse
-
.call ⇒ Object
The main entry point for the
falcon-hostexecutable.
Instance Method Summary collapse
-
#call ⇒ Object
Prepare the environment and run the controller.
-
#container_class ⇒ Object
The container class to use.
Methods included from Paths
#configuration, #resolved_paths
Instance Attribute Details
#paths ⇒ Object (readonly)
One or more paths to the configuration files.
35 |
# File 'lib/falcon/command/host.rb', line 35 many :paths, "Service configuration paths.", default: ["falcon.rb"] |
Class Method Details
.call ⇒ Object
The main entry point for the falcon-host executable.
23 24 25 26 27 28 29 30 |
# File 'lib/falcon/command/host.rb', line 23 def self.call(...) super rescue Interrupt # Ignore. rescue => error Console.error(self, error) exit! 1 end |
Instance Method Details
#call ⇒ Object
Prepare the environment and run the controller.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/falcon/command/host.rb', line 45 def call Console.info(self) do |buffer| buffer.puts "Falcon Host v#{VERSION} taking flight!" buffer.puts "- Configuration: #{@paths.join(', ')}" buffer.puts "- To terminate: Ctrl-C or kill #{Process.pid}" buffer.puts "- To reload: kill -HUP #{Process.pid}" end Async::Service::Controller.run(self.configuration, container_class: self.container_class) end |
#container_class ⇒ Object
The container class to use.
40 41 42 |
# File 'lib/falcon/command/host.rb', line 40 def container_class Async::Container.best_container_class end |