class Puma::DSL

The methods that are available for use inside the configuration file. These same methods are used in Puma cli and the rack handler internally.

Used manually (via CLI class):

config = Configuration.new({}) do |user_config|
  user_config.port 3001
end
config.load

puts config.options[:binds] # => "tcp://127.0.0.1:3001"

Used to load file:

$ cat puma_config.rb
port 3002

Resulting configuration:

config = Configuration.new(config_file: "puma_config.rb")
config.load

puts config.options[:binds] # => "tcp://127.0.0.1:3002"

You can also find many examples being used by the test suite in test/config.

Puma v6 adds the option to specify a key name (String or Symbol) to the hooks that run inside the forked workers. All the hooks run inside the {Puma::Cluster::Worker#run} method.

Previously, the worker index and the LogWriter instance were passed to the hook blocks/procs. If a key name is specified, a hash is passed as the last parameter. This allows storage of data, typically objects that are created before the worker that need to be passed to the hook when the worker is shutdown.

The following hooks have been updated:

| DSL Method         |  Options Key            | Fork Block Location |
| on_worker_boot     | :before_worker_boot     | inside, before      |
| on_worker_shutdown | :before_worker_shutdown | inside, after       |
| on_refork          | :before_refork          | inside              |