Class: Puma::ServerPluginControl

Inherits:
Object
  • Object
show all
Defined in:
lib/puma/server_plugin_control.rb

Overview

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.

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ ServerPluginControl

Returns a new instance of ServerPluginControl.



10
11
12
# File 'lib/puma/server_plugin_control.rb', line 10

def initialize(server)
  @server = server
end

Instance Method Details

#max_threadsObject

Returns the maximum number of threads in the thread pool.



15
16
17
# File 'lib/puma/server_plugin_control.rb', line 15

def max_threads
  @server.max_threads
end

#min_threadsObject

Returns the minimum number of threads in the thread pool.



20
21
22
# 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) ⇒ Object

Updates the minimum and maximum number of threads in the thread pool.



28
29
30
# 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