ri > Puma::ThreadPool

📦 NAME

Puma::ThreadPool < Object

🚀 Quick Reference

Use CaseCommandDescription
Create a new thread poolPuma::ThreadPool.new(min, max, &block)Initialize a pool with minimum and maximum thread counts, and a block to process requests
Add work to the poolpool << clientPush a client request into the @todo array for processing by an available thread
Check pending workpool.backlogReturns the number of requests waiting in the @todo array
Check available capacitypool.pool_capacityReturns the number of threads available to take new work
Trigger graceful shutdownpool.shutdownSignals all threads to stop after finishing current work (not shown in snippet, but typical)
Force shutdown with graceForceShutdown exception + SHUTDOWN_GRACE_TIMEAfter raising ForceShutdown, wait SHUTDOWN_GRACE_TIME for threads to finish before leaving them

📝 Description

Internal Docs for A simple thread pool management object.

Each Puma "worker" has a thread pool to process requests.

First a connection to a client is made in Puma::Server. It is wrapped in a Puma::Client instance and then passed to the Puma::Reactor to ensure the whole request is buffered into memory. Once the request is ready, it is passed into a thread pool via the Puma::ThreadPool#<< operator where it is stored in a @todo array.

Each thread in the pool has an internal loop where it pulls a request from the @todo array and processes it.

📋 Constants

🔧 Class methods

🔧 Instance methods

🏷️ Attributes

Puma::ThreadPool
📦 NAME 🚀 Quick Reference 📝 Description 📋 Constants 🔧 Class methods 🔧 Instance methods 🏷️ Attributes

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 16:32 @216.73.216.194
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format