Flowdock
method

around_perform

Importance_1
v4.2.7 - Show latest stable - 0 notes - Class: ClassMethods
around_perform(*filters, &blk) public

Defines a callback that will get called around the job’s perform method.

class VideoProcessJob < ActiveJob::Base
  queue_as :default

  around_perform do |job, block|
    UserMailer.notify_video_started_processing(job.arguments.first)
    block.call
    UserMailer.notify_video_processed(job.arguments.first)
  end

  def perform(video_id)
    Video.find(video_id).process
  end
end
Show source
Register or log in to add new notes.