class Puma::ServerPluginControl
ServerPluginControl provides a control interface for server plugins to interact with and manage server settings dynamically.
This class acts as a facade between plugins and the Puma server, allowing plugins to safely modify server configuration and thread pool settings without direct access to the server’s internal state.
Public Class Methods
new(server)
click to toggle source
# File lib/puma/server_plugin_control.rb, line 10 def initialize(server) @server = server end
Public Instance Methods
max_threads()
click to toggle source
Returns the maximum number of threads in the thread pool.
# File lib/puma/server_plugin_control.rb, line 15 def max_threads @server.max_threads end
min_threads()
click to toggle source
Returns the minimum number of threads in the thread pool.
# File lib/puma/server_plugin_control.rb, line 20 def min_threads @server.min_threads end
update_thread_pool_min_max(min: max_threads, max: min_threads)
click to toggle source
Updates the minimum and maximum number of threads in the thread pool.
@see Puma::Server#update_thread_pool_min_max
# File lib/puma/server_plugin_control.rb, line 28 def update_thread_pool_min_max(min: max_threads, max: min_threads) @server.update_thread_pool_min_max(min: min, max: max) end