I am using pdfkit middleware on Heroku to generate pdf. How can i make pdf generating thing as a background job.
def index
@products = Product.all
respond_to do |format|
format.html
format.pdf
end
end
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not so simple what the other answers are suggesting in fact.
Implementing delayed job for PDF generation is all well and good. But you have more things to consider – you pass the process over to DJ and the end result is a PDF is generated. But you have to then get that PDF back infront of the user – either by polling the job for when it completes and then providing a link to the pdf possibly, or sending them an email to collect the PDF.