
     @gU                       d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZ d dlmZ ej        dk    rd dlmZ nd dlmZ e	rd d	lmZ  ed
          Z edd          Z G d dee                   Z G d de          ZdS )    )annotationsN)ABCMetaabstractmethod)TracebackType)TYPE_CHECKINGAny	AwaitableCallableTypeVaroverload)warn)      )Protocol)CancelScopeT_RetvalT_contraT)contravariantc                  H    e Zd Zedd            Zedd            ZdddZd	S )
TaskStatusselfTaskStatus[None]returnNonec                    d S N r   s    D/var/www/piapp/venv/lib/python3.11/site-packages/anyio/abc/_tasks.pystartedzTaskStatus.started           valuer   c                    d S r   r   r   r#   s     r   r    zTaskStatus.started   r!   r"   NT_contra | Nonec                    dS )zx
        Signal that the task has started.

        :param value: object passed back to the starter of the task
        Nr   r%   s     r   r    zTaskStatus.started         r"   )r   r   r   r   )r#   r   r   r   r   )r#   r&   r   r   )__name__
__module____qualname__r   r    r   r"   r   r   r      sk           X    X      r"   r   c                      e Zd ZU dZded<   ddddZedddd            Zedddd            Zedd            Z	edd            Z
dS )	TaskGroupz
    Groups several asynchronous tasks together.

    :ivar cancel_scope: the cancel scope inherited by all child tasks
    :vartype cancel_scope: CancelScope
    r   cancel_scopeN)namefuncCallable[..., Awaitable[Any]]argsobjectr/   r   r   c               V   K   t          dt                      | j        |g|R d|i dS )a  
        Start a new task in this task group.

        :param func: a coroutine function
        :param args: positional arguments to call the function with
        :param name: name of the task, for the purposes of introspection and debugging

        .. deprecated:: 3.0
           Use :meth:`start_soon` instead. If your code needs AnyIO 2 compatibility, you
           can keep using this until AnyIO 4.

        zGspawn() is deprecated -- use start_soon() (without the "await") insteadr/   N)r   DeprecationWarning
start_soonr   r0   r/   r2   s       r   spawnzTaskGroup.spawn0   sJ      $ 	U	
 	
 	
 	/t///$/////r"   c                   dS )a  
        Start a new task in this task group.

        :param func: a coroutine function
        :param args: positional arguments to call the function with
        :param name: name of the task, for the purposes of introspection and debugging

        .. versionadded:: 3.0
        Nr   r7   s       r   r6   zTaskGroup.start_soonH   r(   r"   r   c               
   K   dS )a  
        Start a new task and wait until it signals for readiness.

        :param func: a coroutine function
        :param args: positional arguments to call the function with
        :param name: name of the task, for the purposes of introspection and debugging
        :return: the value passed to ``task_status.started()``
        :raises RuntimeError: if the task finishes without calling ``task_status.started()``

        .. versionadded:: 3.0
        Nr   r7   s       r   startzTaskGroup.startY   
        r"   c                
   K   dS )z:Enter the task group context and allow starting new tasks.Nr   r   s    r   
__aenter__zTaskGroup.__aenter__l   r<   r"   exc_typetype[BaseException] | Noneexc_valBaseException | Noneexc_tbTracebackType | Nonebool | Nonec                
   K   dS )z<Exit the task group context waiting for all tasks to finish.Nr   )r   r?   rA   rC   s       r   	__aexit__zTaskGroup.__aexit__p   r<   r"   )r0   r1   r2   r3   r/   r3   r   r   )r0   r1   r2   r3   r/   r3   r   r   )r   r-   )r?   r@   rA   rB   rC   rD   r   rE   )r)   r*   r+   __doc____annotations__r8   r   r6   r;   r>   rG   r   r"   r   r-   r-   &   s            	0 0 0 0 0 00 
 	     ^  
 	     ^$ I I I ^I K K K ^K K Kr"   r-   )	metaclass)
__future__r   sysabcr   r   typesr   typingr   r   r	   r
   r   r   warningsr   version_infor   typing_extensionsanyio._core._tasksr   r   r   r   r-   r   r"   r   <module>rT      s|   " " " " " " 



 ' ' ' ' ' ' ' '       M M M M M M M M M M M M M M M M      v****** /......7:7:T222    (#   "QK QK QK QK QK' QK QK QK QK QK QKr"   