Job finishes, wakes us up

The sleeping request resumes and serves the image

class Website::RenditionJob < ApplicationJob
  def perform(cache)
    rendition = cache.build_rendition
    rendition.render!    # headless Chrome
    rendition.save!
  end

  # ✅ Screenshot done, push "done" to the channel
  after_perform { channel.push("done") }

  # Channel is a Firehose queue over Postgres NOTIFY
  def channel = ApplicationQueue.new(job_id)
end
20 / 45