ruby on rails - How to notify a user after background task is finished? -


i use rails activejob , sidekiq backend. when user come on page sidekiq create long-term background task, how can notice user (by render partial on web page) when task completed?

rails , sidekiq work different processes. fact confused me don't understand how handle completed status using background job.

activejob provides after_perform callback according docs work this:

class videoprocessjob < activejob::base   queue_as :default    after_perform |job|     usermailer.notify_video_processed(job.arguments.first)   end    def perform(video_id)     video.find(video_id).process   end end 

so, don't have worry integrate directly sidekiq or other queuing backend, talk activejob :)


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -