ruby on rails 4 - Sidekiq. Send Callback after job Done -
i using sidekiq sidekiq-status check when work done keep performing action. method use not efficient it.
controller:
myjob = jobcreator.perform_async(my_param) sleep(1) 10.times status = sidekiq::status::get myjob, :job_status if ["ok","fail","nomoney"].include?(status) result << status break end sleep(1) end
how can make on more direct, fast , efficient way?
the pro version of sidekiq has feature called batches includes ability configure callbacks , fetch status of batch.
batches defined collection of jobs, nothing prevents use job in batch.
as far know, that's feature supports callback.
Comments
Post a Comment