Sha256: 768ab8a98118c4b124a499f5ee30d845737dcd9c762b45378b2521933aaf3a19
Contents?: true
Size: 785 Bytes
Versions: 43
Compression:
Stored size: 785 Bytes
Contents
module Bundler module ParallelWorkers class ThreadWorker < Worker private # On platforms where fork is not available # use Threads for parallely downloading gems # # @param size [Integer] Size of thread worker pool # @param func [Proc] Job to be run inside thread worker pool def prepare_workers(size, func) @threads = size.times.map do |i| Thread.start do loop do obj = @request_queue.deq break if obj.equal? POISON begin @response_queue.enq func.call(obj, i) rescue Exception => e @response_queue.enq(WrappedException.new(e)) end end end end end end end end
Version data entries
43 entries across 43 versions & 2 rubygems