Class: Falcon::Controller::Host
- Inherits:
-
Async::Container::Controller
- Object
- Async::Container::Controller
- Falcon::Controller::Host
- Defined in:
- lib/falcon/controller/host.rb
Overview
A generic controller for serving an application. Hosts several Services based on the command configuration.
The configuration is provided by Falcon::Command::Host and is typically loaded from a ‘falcon.rb` file. See Falcon::Configuration#load_file for more details.
Instance Method Summary collapse
-
#create_container ⇒ Object
Create the controller as specified by the command.
-
#initialize(command, **options) ⇒ Host
constructor
Initialize the virtual controller.
-
#setup(container) ⇒ Object
Setup all specified services into the container.
-
#start ⇒ Object
Start all specified services.
-
#stop ⇒ Object
Stop all specified services.
Constructor Details
Instance Method Details
#create_container ⇒ Object
Create the controller as specified by the command. e.g. ‘Async::Container::Forked`.
30 31 32 |
# File 'lib/falcon/controller/host.rb', line 30 def create_container @command.container_class.new end |
#setup(container) ⇒ Object
Setup all specified services into the container.
43 44 45 |
# File 'lib/falcon/controller/host.rb', line 43 def setup(container) @services.setup(container) end |
#start ⇒ Object
Start all specified services.
35 36 37 38 39 |
# File 'lib/falcon/controller/host.rb', line 35 def start @services.start super end |
#stop ⇒ Object
Stop all specified services.
48 49 50 51 52 |
# File 'lib/falcon/controller/host.rb', line 48 def stop(*) @services.stop super end |