This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 0c1df66346973361b3d952fc26d2929fa000d2b2
tree 687c4c10de5216fe4883df786a156238799dbe6e
parent 2f6d4263734e90b0703e39c6b5108ec3dcf4a9cd
tree 687c4c10de5216fe4883df786a156238799dbe6e
parent 2f6d4263734e90b0703e39c6b5108ec3dcf4a9cd
babypool /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
LICENCE | ||
| |
README.rdoc | ||
| |
babypool.gemspec | ||
| |
lib/ | ||
| |
test.rb |
README.rdoc
Baby Pool — Simple thread pool for Ruby.
Baby Pool is a simple, but solid implementation of a thread pool using Ruby green threads. Pools are initialized with a thread count and an execution limit. Baby Pool creates an array or workers each in their own thread that listen for incoming jobs.
The pool will continue to accept work until it is drained by calling the drain method.
A quick example:
- Initialize the pool with a thread count and an execution limit. Each
thread’s worker will timeout it’s current job when it reaches
the pool’s execution limit.
pool = BabyPool.new(:thread_count => 10, :execution_limit => 20) - Give the pool 20 jobs to do.
(0..20).each do |job| pool.work(job) do puts "Running job #{job}." end end - When you are done, shut down the pool by calling the drain method
pool.drain








