123456789_123456789_123456789_123456789_123456789_

Class: Puma::ServerPluginControl

Relationships & Source Files
Inherits: Object
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.

Class Method Summary

Instance Method Summary

Constructor Details

.new(server) ⇒ ServerPluginControl

[ GitHub ]

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

def initialize(server)
  @server = server
end

Instance Method Details

#max_threads

Returns the maximum number of threads in the thread pool.

[ GitHub ]

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

def max_threads
  @server.max_threads
end

#min_threads

Returns the minimum number of threads in the thread pool.

[ GitHub ]

  
# 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)

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

[ GitHub ]

  
# 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