(from /home/chedong/.local/share/rdoc)
| Use Case | Command | Description |
|---|---|---|
| Create a new stack | TimedStack.new(size) { ... } | Create a new timed stack with a given size and block for creating connections |
| Fetch a connection | pop | Pop a connection from the stack, blocking if empty |
| Fetch with timeout | pop(timeout: 5) | Pop a connection with a timeout, raises TimeoutError if exceeded |
| Return a connection | push(conn) | Push a connection back onto the stack |
| Check empty | empty? | Check if stack is empty |
| Check length | length | Number of items currently in stack |
| Get max size | max | Maximum size of the stack |
| Shutdown | shutdown | Shutdown the stack, clearing all connections |
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
new<<empty?lengthmaxpoppushshutdownmax — attr_readerGenerated 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)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format