class Puma::Server
def update_thread_pool_min_max(min: @min_threads, max: @max_threads)
- Example: Update only the maximum threads -
Example: Update only the minimum threads -
Example: Update both min and max threads -
Other tags:
- Note: - If validation fails, a warning message is logged and no changes are made.
Returns:
-
(void)-
Parameters:
-
max(Integer) -- The maximum number of threads allowed in the pool. -
min(Integer) -- The minimum number of threads to maintain in the pool.
def update_thread_pool_min_max(min: @min_threads, max: @max_threads) if min > max @log_writer.log "`min' value cannot be greater than `max' value." return end if min < 0 @log_writer.log "`min' value cannot be less than 0" return end @thread_pool&.with_mutex do @thread_pool.min, @thread_pool.max = min, max @min_threads, @max_threads = min, max end end