Class: Nonnative::HTTPServer
- Defined in:
- lib/nonnative/http_server.rb
Overview
Puma-based HTTP server runner.
This is a convenience server implementation for running a Rack/Sinatra application in-process under Nonnative’s server lifecycle. It binds to the configured proxy host/port (so it works consistently with proxy configuration) and uses Puma for HTTP serving.
The server is started and stopped by Server via #perform_start / #perform_stop.
Note: In YAML configuration you typically set class to a concrete subclass that calls ‘super(app, service)`.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Runner
Instance Method Summary collapse
-
#initialize(app, service) ⇒ HTTPServer
constructor
Creates a Puma server for the given Rack app and runner configuration.
Methods inherited from Server
Methods inherited from Runner
Constructor Details
#initialize(app, service) ⇒ HTTPServer
Creates a Puma server for the given Rack app and runner configuration.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/nonnative/http_server.rb', line 36 def initialize(app, service) log = File.open(service.log, 'a') = { log_writer: Puma::LogWriter.new(log, log), force_shutdown_after: service.timeout } @server = Puma::Server.new(app, Puma::Events.new, ) super(service) end |