class Puma::Server
def reactor_wakeup(client)
(return `false`). When the client sends more data to the socket the `Puma::Client` object
Otherwise, if the full request is not ready then the client will remain in the reactor
ThreadPool, depending on their current state (#can_close?).
If the Reactor is shutting down, all Clients are either timed out or passed to the
and the object is removed from the reactor (return `true`).
If a client object times out, a 408 response is written, its connection is closed,
The Client is then removed from the reactor (return `true`).
so that a "worker thread" can pick up the request and begin to execute application logic.
then the request is passed to the ThreadPool (`@thread_pool << client`)
the `Puma::Client#try_to_finish` method. If the full request has been sent,
The method checks to see if it has the full header and body with
For a graphical representation of how the request buffer works see [architecture.md](https://github.com/puma/puma/blob/master/docs/architecture.md#connection-pipeline).
such as nginx) then the application would be subject to a slow client attack.
If read buffering is not done, and no other read buffering is performed (such as by an application server
before it starts to be processed by the ThreadPool. This may be known as read buffering.
It is responsible for ensuring that a request has been completely received
times out, or when the Reactor is shutting down.
This method is called from the Reactor thread when a queued Client receives data,
def reactor_wakeup(client) shutdown = !@queue_requests if client.try_to_finish || (shutdown && !client.can_close?) @thread_pool << client elsif shutdown || client.timeout == 0 client.timeout! else client.set_timeout(@first_data_timeout) false end rescue StandardError => e client_error(e, client) client.close true end