class Bundler::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
  @func = func
  @threads = size.times.map {|i| Thread.start { process_queue(i) } }
  trap("INT") { abort_threads }
end