sidekiq-superworker icon indicating copy to clipboard operation
sidekiq-superworker copied to clipboard

Running batch jobs by same worker

Open jonsgreen opened this issue 9 years ago • 2 comments

I am exploring options for breaking up a large job into a batch of smaller jobs. I know that sidekiq pro has this ability but I am wondering if this gem has the capacity to do this as well.

What I would like is for an array of values to be passed to the same worker and run in parralel. The number of workers would be determined dynamically by however number of values are passed into the array. So

Superworker.create(:MyBatchSuperworker, :user_ids) do
  batch user_ids: :user_id do
    BatchWorker :user_id
  end
end

when calling:

MyBatchSuperworker.perform_async([10, 11, 12])

would create 3 BatchWorker jobs run at the same time (not serially). Without having tried out the DSL I get the sense that the current expected behavior is for the jobs to be run serially. Is that correct?

How hard would it be to add a feature for running the batches in parallel instead of serially if it does not exist with the current DSL?

jonsgreen avatar Aug 06 '14 06:08 jonsgreen

:+1: I have the exact same use case. This issue was opened 3 months ago, any progress?

xtagon avatar Nov 26 '14 21:11 xtagon

@xtagon: we ended up getting a pro subscription so I did not pursue this further.

jonsgreen avatar Nov 26 '14 21:11 jonsgreen