class Bundler::ParallelWorkers::Worker

def initialize(size, func)

Parameters:
  • func (Proc) -- job to run in inside the worker pool
  • size (Integer) -- Size of pool
def initialize(size, func)
  @request_queue = Queue.new
  @response_queue = Queue.new
  prepare_workers size, func
  prepare_threads size
  trap("INT") { @threads.each {|i| i.exit }; stop_workers; exit 1 }
end