Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 377 Bytes

File metadata and controls

11 lines (7 loc) · 377 Bytes

Background Tasks - BackgroundTasks

You can declare a parameter in a path operation function or dependency function with the type BackgroundTasks, and then you can use it to schedule the execution of background tasks after the response is sent.

You can import it directly from fastapi:

from fastapi import BackgroundTasks

::: fastapi.BackgroundTasks