Module: Ratalada::Backends::Puma

Defined in:
lib/ratalada/puma.rb

Class Method Summary collapse

Class Method Details

.run(app, host:, port:, count: 1) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/ratalada/puma.rb', line 11

def run(app, host:, port:, count: 1)
  warn "ratalada: puma backend ignores count: (not yet implemented)" if count > 1
  server = ::Puma::Server.new(app)
  server.add_tcp_listener(host, port)
  warn "ratalada: puma listening on http://#{host}:#{port}"
  server.run.join
rescue Interrupt
  server.stop(true)
end