* Extract calls to purge_interrupt_queue
Move calls to Thread#purge_interrupt_queue to a module function. This
means if/when this pattern needs to change it can change in one place
instead of a dozen or more places.
* Update comment on purge_interrupt_queue [ci skip]
* Rename Puma::Cluster::{Worker => WorkerHandle}
This class represents a worker from the perspective of the puma master
process. It provides methods for controlling the process, but doesn't
contain the logic actually executed by the worker.
In preparation for creating a new class that encapsulates the worker
logic, we're renaming this one to WorkerHandle.
* Extract Puma::Cluster::WorkerHandle to a separate file
* Move worker functionality to new class
Before, all functionality of the worker processes was defined in the
Cluster class. In preparation for making it possible to start worker
processes outside of the context of a Cluster instance, we move the
worker functionality into a new class.
This has the additional benefit of delineating exactly the dependencies
of the worker processes, namely the Launcher, options hash, and the
pipes used for inter-process communication.
* Extract nakayoshi_gc to Puma::Util
* Add comment to describe Puma::Cluster::WorkerHandle
* Remove options from Worker constructor
The instance varaible @options can be derived from the @launcher
Reduces runtime allocation by freezing string literals by default.
We could also remove a ton of manual `.freeze` calls, however the ruby supported version is 2.2 and the magic comment only targets 2.3+.
Because frameworks like rails dependent on rack, if puma truly wants to
be able to reload new code and thus new versions of rails, it has to be
able to reload rack as well.
Having a dependency on rack held by puma prevented that from happening
and so that dependency has been removed.