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 server ‘host` and first `ports` entry.
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 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.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/nonnative/http_server.rb', line 35 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 |