I'm using flask/python to implement REST API and I would like to run each response in a child process. I need this since I want to apply SECCOMP security extension after forking.
So far I'm doing the following in the request handler:
- Fork
- In a child - return the response
- In a parent - wait for child
What's puzzling, is what to do in parent after child is done. Flask requires me to return some response from parent as well - but everything was already returned from a child. Is there way to signify that Flask nothing should be done in the parent handler?
Clarification: I want the child itself to write the response - the amount of returned data can be quite massive and I don't want to relay it through parent. This is different from other questions, because parent should not touch socket at all (even not for 204 response, which writes headers anyway) - it only should somehow say to dispatcher "ok, I'm done with response" once child has finished.