flâneur — a map of the web's best reading

Background Tasks - FastAPI

fastapi.tiangolo.com · 1,252 words · saved by 1 readers

FastAPI framework, high performance, easy to learn, fast to code, ready for production

Background Tasks ¶ You can define background tasks to be run after returning a response. This is useful for operations that need to happen after a request, but that the client doesn't really have to be waiting for the operation to complete before receiving the response. This includes, for example: Email notifications sent after performing an action: As connecting to an email server and sending an email tends to be "slow" (several seconds), you can return the response right away and send the email notification in the background. Processing data: For example, let's say you receive a file th

Explore this link on the map →

related reading