Sha256: a9f24c2d9696e2ea19b6573f2646aafd31a8c3827c848f4bb2c0b10977efeb11
Contents?: true
Size: 443 Bytes
Versions: 1
Compression:
Stored size: 443 Bytes
Contents
require_relative "team_effort/version" module TeamEffort def self.work(enumerable, max_process_count = 4) pids = [] enumerable.each do |args| while pids.size == max_process_count finished_pid = Process.wait pids.delete finished_pid end pids << fork do yield args end end while !pids.empty? finished_pid = Process.wait pids.delete finished_pid end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
team_effort-0.0.3 | lib/team_effort.rb |