Monday, June 28, 2021

FastAPI Background Tasks for Non-Blocking Endpoints

With FastAPI it is super easy to implement a non-blocking endpoint. This is useful when the endpoint calls logic, which should be executed asynchronously and you don't need to wait for the result, but want to return a response immediately. For example - a service that does logging. We don't want to wait until the log will be written but return the response instantly.

 

No comments: