0
batch = Sidekiq::Batch.new
batch.description = "Batch description (this is optional)"
batch.on(:success, MyCallback, :to => user.email)
batch.jobs do
rows.each { |row| RowWorker.perform_async(row) }
end
sleep(x_seconds)
batch.jobs do
rows.each { |row| RowWorker.perform_async(row) }
end
puts "Just started Batch #{batch.bid}"
在上面的代码中,可能会在添加下一个批处理作业之前调用回调..因此有办法通知sidekiq pro不要调用回调,因为批处理中的作业尚未被添加?sidekiq如何知道批次的所有工作?
很酷..谢谢:) – david