ri > ConnectionPool::TimedStack

ConnectionPool::TimedStack < Object

(from /home/chedong/.local/share/rdoc)

🚀 Quick Reference

Use CaseCommandDescription
Create a new stackTimedStack.new(size) { ... }Create a new timed stack with a given size and block for creating connections
Fetch a connectionpopPop a connection from the stack, blocking if empty
Fetch with timeoutpop(timeout: 5)Pop a connection with a timeout, raises TimeoutError if exceeded
Return a connectionpush(conn)Push a connection back onto the stack
Check emptyempty?Check if stack is empty
Check lengthlengthNumber of items currently in stack
Get max sizemaxMaximum size of the stack
ShutdownshutdownShutdown the stack, clearing all connections

📚 Examples

ts = TimedStack.new(1) { MyConnection.new }

# fetch a connection
conn = ts.pop

# return a connection
ts.push conn

conn = ts.pop
ts.pop timeout: 5
#=> raises ConnectionPool::TimeoutError after 5 seconds

🛠️ Class Methods

🔧 Instance Methods

🏷️ Attributes

ConnectionPool::TimedStack
ConnectionPool::TimedStack < Object 🚀 Quick Reference 📚 Examples 🛠️ 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-28 01:04 @216.73.217.25
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