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

        :param value: object passed back to the starter of the task
        N )selfr   r   r   K/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/anyio/abc/_tasks.pystarted       zTaskStatus.started)N)__name__
__module____qualname__r   objectr   r   r   r   r   r      s    r   )	metaclassc                
   @   s   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dZ	e
dddedeeeef f ded	ed
dfddZe
dddedeeeef f ded	ed
efddZe
dddZe
deee  dee dee d
ee f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.argsr   r   c                   s(   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    r   r   r   spawn!   s   zTaskGroup.spawnc                G   r   )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#   r   r   r   r"   9   r   zTaskGroup.start_soonc                      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#   r   r   r   startJ       zTaskGroup.startc                    r%   )z:Enter the task group context and allow starting new tasks.Nr   )r   r   r   r   
__aenter__]   r'   zTaskGroup.__aenter__exc_typeexc_valexc_tbc                    r%   )z<Exit the task group context waiting for all tasks to finish.Nr   )r   r)   r*   r+   r   r   r   	__aexit__a   r'   zTaskGroup.__aexit__)r   r   )r   r   r   __doc____annotations__r   r   r   r   r$   r   r"   r&   r(   r   r	   BaseExceptionr   boolr,   r   r   r   r   r      s^   
 

r   )typingabcr   r   typesr   r   r   r   r   r	   r
   warningsr   TYPE_CHECKINGanyio._core._tasksr   r   r   r   r   r   r   r   <module>   s     
