Class: Nonnative::HTTPServer

Inherits:
Server show all
Defined in:
lib/nonnative/http_server.rb

Direct Known Subclasses

HTTPProxyServer

Instance Attribute Summary

Attributes inherited from Runner

#proxy

Instance Method Summary collapse

Methods inherited from Server

#start, #stop

Methods inherited from Runner

#name

Constructor Details

#initialize(app, service) ⇒ HTTPServer

Returns a new instance of HTTPServer.



5
6
7
8
9
10
11
12
13
14
# File 'lib/nonnative/http_server.rb', line 5

def initialize(app, service)
  log = File.open(service.log, 'a')
  options = {
    log_writer: Puma::LogWriter.new(log, log),
    force_shutdown_after: service.timeout
  }
  @server = Puma::Server.new(app, Puma::Events.new, options)

  super(service)
end