FastAPI finish streaming function in StreamingResponse even if client closed the connection

18 Views Asked by At

I think the title is pretty self explanatory.

FastAPI automatically closes the connection and cancels an operation if the client disconnects.

Is there an easy way (not a celery-redis type solution) to have the server finish running the generator function regardless?

0

There are 0 best solutions below