o
    Èhè  ã                   @   sL   d dl mZmZ d dlmZ d dlmZmZm	Z	 e	dƒZ
G dd„ deƒZdS )é    )ÚAnyÚCallable)ÚBackgroundTasks)Ú	AnnotatedÚDocÚ	ParamSpecÚPc                       sJ   e Zd ZdZdeeeef edƒf dej	dej
ddf‡ fdd	„Z‡  ZS )
r   aG  
    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                    s   t ƒ j|g|¢R i |¤Ž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__© úf/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/fastapi/background.pyr   &   s   zBackgroundTasks.add_task)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r
   r   r   Ú__classcell__r   r   r   r   r   	   s"    
ÿÿÿþôóòr   N)Útypingr   r   Ústarlette.backgroundr   ÚStarletteBackgroundTasksÚtyping_extensionsr   r   r   r   r   r   r   r   Ú<module>   s
    