class Bundler::ParallelWorkers::UnixWorker
def prepare_threads(size)
-
size
(Integer
) -- Number of threads to be started
def prepare_threads(size) @threads = size.times.map do |i| Thread.start do worker = @workers[i] loop do obj = @request_queue.deq break if obj.equal? POISON @response_queue.enq worker.work(obj) end end end end