class Falcon::Controller::Host
A generic controller for serving an application. Hosts several {Services} based on the command configuration.
The configuration is provided by {Command::Host} and is typically loaded from a `falcon.rb` file. See {Configuration#load_file} for more details.
Public Class Methods
new(command, **options)
click to toggle source
Initialize the virtual controller. @parameter command [Command::Host] The user-specified command-line options.
Calls superclass method
# File lib/falcon/controller/host.rb, line 36 def initialize(command, **options) @command = command @configuration = command.configuration @services = Services.new(@configuration) super(**options) end
Public Instance Methods
create_container()
click to toggle source
Create the controller as specified by the command. e.g. `Async::Container::Forked`.
# File lib/falcon/controller/host.rb, line 47 def create_container @command.container_class.new end
setup(container)
click to toggle source
Setup all specified services into the container. @parameter container [Async::Container::Generic]
# File lib/falcon/controller/host.rb, line 60 def setup(container) @services.setup(container) end
start()
click to toggle source
Start all specified services.
Calls superclass method
# File lib/falcon/controller/host.rb, line 52 def start @services.start super end
stop(*)
click to toggle source
Stop all specified services.
Calls superclass method
# File lib/falcon/controller/host.rb, line 65 def stop(*) @services.stop super end