bundle-new/lib/bundler/parallel_workers.rb

19 lines
478 B
Ruby
Raw Permalink Normal View History

2019-10-06 15:45:34 +00:00
require 'thread'
require "bundler/parallel_workers/worker"
module Bundler
module ParallelWorkers
autoload :UnixWorker, "bundler/parallel_workers/unix_worker"
autoload :ThreadWorker, "bundler/parallel_workers/thread_worker"
def self.worker_pool(size, job)
if Bundler.current_ruby.mswin? || Bundler.current_ruby.jruby? || Bundler.current_ruby.rbx?
ThreadWorker.new(size, job)
else
UnixWorker.new(size, job)
end
end
end
end