I have an API, which will call 10 functions inside it. Now these 10 functions can take up more than 5-10 min and these functions need to run one be one.
To achieve this, I am using backgroundTask provided by FastAPI and then running the task inside it.
Now in some functions I am trying to use multiprocessing but when i am trying to do so, it says, daemonic process can’t have children.
So I have two questions, whether we can use multiprocessing inside backgroundTask and if yes, how?
I tried using multiprocessing code but getting daemonic process can’t have children. I tried using multithreading and it is working fine using multithreading.
Punit Tiwari is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2