o
    OÊÆhU  ã                   @  sÎ   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	rHd d	lmZ ed
ƒZeddd�ZG dd„ dee ƒZG dd„ ded�ZdS )é    )ÚannotationsN)ÚABCMetaÚabstractmethod)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚ	AwaitableÚCallableÚTypeVarÚoverload)Úwarn)é   é   )ÚProtocol)ÚCancelScopeÚT_RetvalÚT_contraT)Úcontravariantc                   @  s4   e Zd Zeddd„ƒZedd	d„ƒZdddd„Zd
S )Ú
TaskStatusÚselfúTaskStatus[None]ÚreturnÚNonec                 C  ó   d S ©N© ©r   r   r   ú]/var/www/html/HyperOracle/crypto_trader/venv/lib/python3.10/site-packages/anyio/abc/_tasks.pyÚstarted   ó   zTaskStatus.startedÚvaluer   c                 C  r   r   r   ©r   r    r   r   r   r      r   NúT_contra | Nonec                 C  ó   dS )zx
        Signal that the task has started.

        :param value: object passed back to the starter of the task
        Nr   r!   r   r   r   r      ó    )r   r   r   r   )r    r   r   r   r   )r    r"   r   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s    r   c                   @  sn   e Zd ZU dZded< ddœddd„Zeddœddd„ƒZeddœd dd„ƒZed!dd„ƒZ	ed"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                Ç  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   Úspawn0   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   r1   r   r   r   r0   H   r$   zTaskGroup.start_soonr   c                Ç  ó   �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   r1   r   r   r   ÚstartY   ó    zTaskGroup.startc                 Ã  r3   )z:Enter the task group context and allow starting new tasks.Nr   r   r   r   r   Ú
__aenter__l   r5   zTaskGroup.__aenter__Úexc_typeútype[BaseException] | NoneÚexc_valúBaseException | NoneÚexc_tbúTracebackType | Noneúbool | Nonec                 Ã  r3   )z<Exit the task group context waiting for all tasks to finish.Nr   )r   r7   r9   r;   r   r   r   Ú	__aexit__p   r5   zTaskGroup.__aexit__)r+   r,   r-   r.   r*   r.   r   r   )r+   r,   r-   r.   r*   r.   r   r   )r   r(   )r7   r8   r9   r:   r;   r<   r   r=   )r%   r&   r'   Ú__doc__Ú__annotations__r2   r   r0   r4   r6   r>   r   r   r   r   r(   &   s   
 üüü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   r   Ú<module>   s     
