Class: Falcon::Command::Serve
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Falcon::Command::Serve
- Defined in:
- lib/falcon/command.rb
Instance Method Summary collapse
Instance Method Details
#container_class ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/falcon/command.rb', line 55 def container_class case [:container] when :threaded require 'async/container/threaded' return Async::Container::Threaded when :forked require 'async/container/forked' return Async::Container::Forked end end |
#invoke ⇒ Object
78 79 80 81 82 |
# File 'lib/falcon/command.rb', line 78 def invoke run sleep end |
#run ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/falcon/command.rb', line 66 def run app, = Rack::Builder.parse_file([:config]) container_class.new(concurrency: [:concurrency]) do server = Falcon::Server.new(app, [ Async::IO::Endpoint.parse([:bind], reuse_port: true) ]) server.run end end |