imagine that you had a task that finished in, say 10 seconds. Now, after the 10 seconds pass, the user has to be redirected back to a specific page with the results of that task. This redirection has to happen, even if the user is viewing another page.
As you can imagine, there is a start and end time in the model that shows when the event started and when it ends. My question is, how would you design that, also taking a close look into security ?
I do it this way currently : I have a global before_filter which has a method that constantly checks on whether the event has finished and sets a session variable to 1 if so. If it's indeed finished, it redirects to a GET action that is only reachable if the session variable is set to 1.
This latter action is doing the things i need and renders information back to the user. Do you think i'm handling it correctly, or you would do things differently ?