diff --git a/Gemfile.lock b/Gemfile.lock index 81e55fd94..9d1fb95fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,6 +10,7 @@ PATH specs: tapioca (0.7.0) bundler (>= 1.17.3) + parallel (>= 1.21.0) pry (>= 0.12.2) rbi (~> 0.0.0, >= 0.0.14) sorbet-static-and-runtime (>= 0.5.9204) diff --git a/lib/tapioca/executor.rb b/lib/tapioca/executor.rb index ed1664793..c86bfaa05 100644 --- a/lib/tapioca/executor.rb +++ b/lib/tapioca/executor.rb @@ -20,10 +20,6 @@ def initialize(queue, number_of_workers: nil) number_of_workers || [Etc.nprocessors, (queue.length.to_f / MINIMUM_ITEMS_PER_WORKER).ceil].min, Integer ) - - # The number of items that will be processed per worker, so that we can split the queue into groups and assign - # them to each one of the workers - @items_per_worker = T.let((queue.length.to_f / @number_of_workers).ceil, Integer) end sig do diff --git a/tapioca.gemspec b/tapioca.gemspec index 78a387cba..d4232a22a 100644 --- a/tapioca.gemspec +++ b/tapioca.gemspec @@ -24,6 +24,7 @@ Gem::Specification.new do |spec| spec.metadata["allowed_push_host"] = "https://rubygems.org" spec.add_dependency("bundler", ">= 1.17.3") + spec.add_dependency("parallel", ">= 1.21.0") spec.add_dependency("pry", ">= 0.12.2") spec.add_dependency("rbi", "~> 0.0.0", ">= 0.0.14") spec.add_dependency("sorbet-static-and-runtime", ">= 0.5.9204")