§
    6xÅj÷  ã                   ó„   — d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z d dlmZ  ed¦  «        Z G d„ d	e¦  «        Z
d
S )é    )ÚCallable)Ú	AnnotatedÚAny)ÚDoc)Ú
_operation)ÚBackgroundTasks)Ú	ParamSpecÚPc                   ó‚   ‡ — 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„Zd
d	„Zˆ x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                 ó>   •—  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__s       €úCC:\Projects\Historical\venv\Lib\site-packages\fastapi/background.pyr   zBackgroundTasks.add_task)   s,   ø€ ð*  �u‰wŒwÔ Ð6 tÐ6Ð6Ð6¨vÐ6Ð6Ð6ó    c              ƒ   óš   K  — | j         D ]@}t          d|j        ¬¦  «        5   |¦   «         ƒ d {V —† d d d ¦  «         n# 1 swxY w Y   ŒAd S )NÚbackground_task)ÚnameÚfunction)Útasksr   r   )r   Útasks     r   Ú__call__zBackgroundTasks.__call__@   s¤   è è € Ø”Jð 	ð 	ˆDÝÐ!2¸T¼YÐGÑGÔGð ð Ø�d‘f”f�������ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð øð	ð 	s   ¢?¿A	ÁA	)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r
   r   r   r   r   r   r   Ú__classcell__)r   s   @r   r   r      s¯   ø€ € € € € ðð ð87àØ�Q˜�VÔØˆCðñô ðô	
ð7ð Œvð7ð ”(ð7ð 
ð7ð 7ð 7ð 7ð 7ð 7ð.ð ð ð ð ð ð ð r   r   N)Úcollections.abcr   Útypingr   r   Úannotated_docr   Úfastapi.telemetry._apir   Ústarlette.backgroundr   ÚStarletteBackgroundTasksÚtyping_extensionsr	   r
   © r   r   ú<module>r+      s¹   ðØ $Ð $Ð $Ð $Ð $Ð $Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !à Ð Ð Ð Ð Ð Ø -Ð -Ð -Ð -Ð -Ð -Ø LÐ LÐ LÐ LÐ LÐ LØ 'Ð 'Ð 'Ð 'Ð 'Ð 'à€Iˆc�N„N€ð7ð 7ð 7ð 7ð 7Ð.ñ 7ô 7ð 7ð 7ð 7r   