I feel like this is a dumb question, because everyone seems to gloss over this aspect of things.
My need is simple - I'm running some reports using Ruport on Heroku. Complicated reports take a long time, and they time out. I've decided to use delayed_job - but I could use something else instead. Once I know what I'm doing, I might use it for other things as well.
I see lots of examples, railscasts, documentation about how to get delayed_job and its brethren up and running, how to manage your job queue, etc. I might have some questions once I get to that point, but for now...
How the heck do I get back to my queued job?
Right now, I just generate the output like this:
@report_output = @report_controller.render(@report_format,@report_params)
send_data @report_output, :filename => "#{@report_type}.#{@report_format}", :type => "application/#{@report_format}" unless :html == @report_format
(and then if it is an html report, it just renders the page normally)
it works fine in development, times out in production. I can see from the documentation it would even be pretty easy to just generate the output and mail it to the user, then I don't have to worry about getting the job back.
But I don't want that. I just want to show the user a progress page, poll the server regularly until it's done, and then redirect them to see the HTML or PDF output. I'm expecting this to return some sort of ID of the job and hand it back to the user so they can check on it, but I don't see where that comes from. I suppose I could just look in the table, but that seems silly. I could possibly even show the user a list of queued/completed jobs and let them choose one manually, but that's overkill. They just want to download a report, and they don't mind if it takes a minute or two.
I'm not actually using a table for my reports, no need, they're not being saved - but I suppose could give them a table and an ActiveRecord model if that helped. It doesn't seem like I should have to do that. I'm using Rails 2.3, but it doesn't look like that's relevant to my question either.
It seems like what I'm asking is so obvious that no one has bothered to write it down, but I can't seem to find it. Is there a sample app? What am I missing? I feel foolish.