
    "d/                         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        rd dlmZ  ed          Z G d d	e
          Z G d de
          ZdS )    N)ABCMetaabstractmethod)TracebackType)AnyCallable	CoroutineOptionalTypeTypeVar)warn)CancelScopeT_Retvalc                   0    e Zd Zeddeddfd            ZdS )
TaskStatusNvaluereturnc                     dS )zx
        Signal that the task has started.

        :param value: object passed back to the starter of the task
        N )selfr   s     4D:\api_v1\venv\Lib\site-packages\anyio/abc/_tasks.pystartedzTaskStatus.started             )N)__name__
__module____qualname__r   objectr   r   r   r   r   r      sE         V t    ^  r   r   )	metaclassc            
       z   e Zd ZU dZded<   dddedeeeef         f         ded	ed
dfdZ	e
dddedeeeef         f         ded	ed
dfd            Ze
dddedeeeef         f         ded	ed
efd            Ze
dd            Ze
deee                  dee         dee         d
ee         f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.argsr"   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   r#   r"   r$   s       r   spawnzTaskGroup.spawn!   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   r(   s       r   r'   zTaskGroup.start_soon9   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   r(   s       r   startzTaskGroup.startJ   
        r   c                 
   K   dS )z:Enter the task group context and allow starting new tasks.Nr   )r   s    r   
__aenter__zTaskGroup.__aenter__]   r-   r   exc_typeexc_valexc_tbc                 
   K   dS )z<Exit the task group context waiting for all tasks to finish.Nr   )r   r0   r1   r2   s       r   	__aexit__zTaskGroup.__aexit__a   r-   r   )r   r    )r   r   r   __doc____annotations__r   r   r   r   r)   r   r'   r,   r/   r	   r
   BaseExceptionr   boolr4   r   r   r   r    r       s            	0 0 0sIc3m4450 0 	0
 
0 0 0 00 
 	  sIc3m445  	
 
   ^  
 	  sIc3m445  	
 
   ^$ I I I ^I K4./K -(K '	K
 
$K K K ^K K Kr   r    )typingabcr   r   typesr   r   r   r   r	   r
   r   warningsr   TYPE_CHECKINGanyio._core._tasksr   r   r   r    r   r   r   <module>r?      s$    ' ' ' ' ' ' ' '       D D D D D D D D D D D D D D D D      	 /......7:    7    QK QK QK QK QK' QK QK QK QK QK QKr   