No commit activity in last 3 years
No release in over 3 years
You can easily run number limited threads in parallel with ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Ruby Thread Pool

Build Status

Install

gem install ruby_thread_pool

All In Parallel

require "thread_pool"
require "open-uri"
urls = ["http://google.com", "http://juergenbickert.de", "http://github.com"]
urls.peach {|url| open(url).read }

All urls are retrieved in parallel. There is no limit on the amount of threads run in parallel.

Limited Thread Pool Size

require "thread_pool"
20.times.to_a.peach(10) { sleep(0.1) }

It limits the thread pool size to 10 threads. So at any point in time there are at max running 10 threads, and it finishes in 0.2 seconds.

Why is it better than peach

Because peach fails the third spec, unlike this fine piece of framework

a = [0.01,0.01,0.2,0.2, 0.01, 0.01,0.01,0.01,0.01,0.01]
start = Time.now
a.peach(5) do |time|
  sleep time
end
stop = Time.now
elapsed = stop - start
elapsed.must_be :>=, 0.2
elapsed.must_be :<=, 0.3