workaholic¶ ↑
Parallel job runner.
sample code¶ ↑
require 'rubygems' require 'workaholic' class TestJob < Workaholic::Job attr_reader :count def initialize; @count = 0 end def run; @count += 1 end end worker = Workaholic.new job = TestJob.new worker.start 100 do # 100 threads 1000.times do worker.push job end end p job.count # => 1000
Copyright¶ ↑
Copyright © 2012 mewlist. See LICENSE.txt for further details.