Class | Puma::Server |
In: |
lib/puma/server.rb
|
Parent: | Object |
app | [RW] | |
auto_trim_time | [RW] | |
binder | [RW] | |
events | [R] | |
leak_stack_on_error | [RW] | |
max_threads | [RW] | |
min_threads | [RW] | |
persistent_timeout | [RW] | |
thread | [R] |
Create a server for the rack app app.
events is an object which will be called when certain error events occur to be handled. See Puma::Events for the list of current methods to implement.
Server#run returns a thread that you can join on to wait for the server to do it‘s work.
Given the request env from client and a partial request body in body, finish reading the body if there is one and invoke the rack app. Then construct the response and write it back to client
cl is the previously fetched Content-Length header if there was one. This is an optimization to keep from having to look it up again.
Given a Hash env for the request read from client, add and fixup keys to comply with Rack‘s env guidelines.
Given a connection on client, handle the incoming requests.
This method support HTTP Keep-Alive so it may, depending on if the client indicates that it supports keep alive, wait for another request before returning.
Given the requset env from client and the partial body body plus a potential Content-Length value cl, finish reading the body and return it.
If the body is larger than MAX_BODY, a Tempfile object is used for the body, otherwise a StringIO is used.
Runs the server.
If background is true (the default) then a thread is spun up in the background to handle requests. Otherwise requests are handled synchronously.