I have a FastAPI app, which handles each request by allocating a process from Processpoolexecutor. What if the request is cancelled, and how to stop the running process?
I’ve seen the ways that passing a stop_event to the CPU intensive function. That seems like we need to write check condition lines everywhere around the function.