This is follow-on to Return output of subprocess.popen() in webserver. I have a long running process that is kicked off by a Webserver call (running Django).
I’m using subprocess.popen()
to spawn the process. I figured out how I can save the stdout and retrieve it later. But since this is a long-running process, I want the client to be able to cancel it. But in order to do that, I need an instance of the popen()
object. But it is not serialiable, so I can’t store it in a database or anywhere else?
Is there any other solution other that just storing it locally in a map in views.py
?