I am trying to write an application that will allow a user to launch a fairly long-running process (5-30 seconds). It should then allow the user to check the output of the process as it is generated. The output will only be needed for the user's current session so nothing needs to be stored long-term. I have two questions regarding how to accomplish this while taking advantage of the Pylons framework:
What is the best way to launch a background process such as this with a Pylons controller?
What is the best way to get the output of the background process back to the user? (Should I store the output in a database, in session data, etc.?)
Edit:
The problem is if I launch a command using subprocess
in a controller, the controller waits for the subprocess to finish before continuing, showing the user a blank page that is just loading until the process is complete. I want to be able to redirect the user to a status page immediately after starting the subprocess, allowing it to complete on its own.