Repository: puma/puma
File: lib/puma/dsl.rb (Ruby)

Code before:
    # cases, such as a single threaded application, it may be
    # better to ensure requests get balanced across workers.
    #
    # Note that setting this to false disables HTTP keepalive and
    # slow clients will occupy a handler thread while the request
    # is being sent. A reverse proxy, such as nginx, can handle
    # slow clients and queue requests before they reach Puma.
    #
    # The default is +true+.
    #
    # @see Puma::Server
    #
    def queue_requests(answer=true)
      @options[:queue_requests] = answer
    end

    # When a shutdown is requested, the backtraces of all the
    # threads will be written to $stdout. This can help figure
    # out why shutdown is hanging.
    #
    def shutdown_debug(val=true)
      @options[:shutdown_debug] = val
    end


    # Maximum delay of worker (process) accept loop (when workers >= 2)
    #
    # Attempts to route traffic to less-busy workers by causing them to delay
    # listening on the socket, allowing workers which are not processing as many
    # requests to pick up new requests first.
    #
    # The default is 0.005 seconds.
    #
    # Only takes effect when there are two or more workers. For interpreters that
    # do not support forking, this setting does nothing.
    #
    # To turn off this feature, set the value to 0.
    #
    # @see Puma::Server#handle_servers
    # @see Puma::ThreadPool#wait_for_less_busy_worker
    #
    def wait_for_less_busy_worker(val=0.005)
      @options[:wait_for_less_busy_worker] = val.to_f
    end

    # Control how the remote address of the connection is set. This
    # is configurable because to calculate the true socket peer address
    # a kernel syscall is required which for very fast rack handlers
    # slows down the handling significantly.
    #
    # There are 5 possible values:

Review comment (suggestion):
Nits.

1. I think it's obvious to Puma users that worker == process. We don't clarify this in any other DSL docs, nor should we need to—this should be assumed knowledge at this point (imo).
2. We can use notes to highlight that this is a cluster-only config (and in this case also only when workers >= 2) to be consistent with other configs (see my suggestion below).

```suggestion
    # Maximum delay of worker accept loop.
```

Code after:
    # cases, such as a single threaded application, it may be
    # better to ensure requests get balanced across workers.
    #
    # Note that setting this to false disables HTTP keepalive and
    # slow clients will occupy a handler thread while the request
    # is being sent. A reverse proxy, such as nginx, can handle
    # slow clients and queue requests before they reach Puma.
    #
    # The default is +true+.
    #
    # @see Puma::Server
    #
    def queue_requests(answer=true)
      @options[:queue_requests] = answer
    end

    # When a shutdown is requested, the backtraces of all the
    # threads will be written to $stdout. This can help figure
    # out why shutdown is hanging.
    #
    def shutdown_debug(val=true)
      @options[:shutdown_debug] = val
    end


    # Maximum delay of worker accept loop.
    #
    # Attempts to route traffic to less-busy workers by causing a busy worker to delay
    # listening on the socket, allowing workers which are not processing as many
    # requests to pick up new requests first.
    #
    # The default is 0.005 seconds.
    #
    # To turn off this feature, set the value to 0.
    #
    # @note Cluster mode with >= 2 workers only.
    #
    # @note Interpreters with forking support only.
    #
    # @see Puma::Server#handle_servers
    # @see Puma::ThreadPool#wait_for_less_busy_worker
    #
    def wait_for_less_busy_worker(val=0.005)
      @options[:wait_for_less_busy_worker] = val.to_f
    end

    # Control how the remote address of the connection is set. This
    # is configurable because to calculate the true socket peer address
    # a kernel syscall is required which for very fast rack handlers
    # slows down the handling significantly.
    #