� K�g���h�ddlmZmZddlmZddlmZmZm Z e d��Z Gd�de��ZdS)�)�Any�Callable)�BackgroundTasks)� Annotated�Doc� ParamSpec�Pc�z��eZdZdZdeeeefed��fdej dej ddf�fd� Z �xZ S) raG A collection of background tasks that will be called after a response has been sent to the client. Read more about it in the [FastAPI docs for Background Tasks](https://fastapi.tiangolo.com/tutorial/background-tasks/). ## Example ```python from fastapi import BackgroundTasks, FastAPI app = FastAPI() def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: content = f"notification for {email}: {message}" email_file.write(content) @app.post("/send-notification/{email}") async def send_notification(email: str, background_tasks: BackgroundTasks): background_tasks.add_task(write_notification, email, message="some notification") return {"message": "Notification sent in the background"} ``` �funcz� The function to call after the response is sent. It can be a regular `def` function or an `async def` function. �args�kwargs�returnNc�>��t��j|g|�Ri|��S)z� Add a function to be called in the background after the response is sent. Read more about it in the [FastAPI docs for Background Tasks](https://fastapi.tiangolo.com/tutorial/background-tasks/). )�super�add_task)�selfr r r � __class__s ��b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fastapi/background.pyrzBackgroundTasks.add_task&s,���* �u�w�w���6�t�6�6�6�v�6�6�6�) �__name__� __module__� __qualname__�__doc__rrr rrr r r� __classcell__)rs@rrr s����������87�� �Q��V� � �C�� � � �  �7��v�7��(�7� �7�7�7�7�7�7�7�7�7�7rrN) �typingrr�starlette.backgroundr�StarletteBackgroundTasks�typing_extensionsrrrr �rr�<module>r s��� � � � � � � � �L�L�L�L�L�L�7�7�7�7�7�7�7�7�7�7� �I�c�N�N��27�27�27�27�27�.�27�27�27�27�27r
Memory