o
    \h
                     @  s   d dl mZ d dlZd dlmZm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 ejdkr<d dlmZmZ nd dlmZmZ erLd	d
lmZ edZedddZedZG dd dee ZG dd dedZdS )    )annotationsN)ABCMetaabstractmethod)	AwaitableCallable)TracebackType)TYPE_CHECKINGAnyProtocolTypeVaroverload)      )TypeVarTupleUnpack   )CancelScopeT_RetvalT_contraT)contravariantPosArgsTc                   @  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   S/home/air/segue/gemini/backup/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                   @  s^   e Zd ZU dZded< 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[[Unpack[PosArgsT]], Awaitable[Any]]argsUnpack[PosArgsT]r-   objectr   r   c                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-   r0   r   r   r    
start_soon/   r'   zTaskGroup.start_soonCallable[..., Awaitable[Any]]r	   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   r3   r   r   r    start@       zTaskGroup.startc                   r6   )z:Enter the task group context and allow starting new tasks.Nr   r   r   r   r    
__aenter__T   r8   zTaskGroup.__aenter__exc_typetype[BaseException] | Noneexc_valBaseException | Noneexc_tbTracebackType | Nonebool | Nonec                   r6   )z<Exit the task group context waiting for all tasks to finish.Nr   )r   r:   r<   r>   r   r   r    	__aexit__X   r8   zTaskGroup.__aexit__)r.   r/   r0   r1   r-   r2   r   r   )r.   r5   r0   r2   r-   r2   r   r	   )r   r+   )r:   r;   r<   r=   r>   r?   r   r@   )
r(   r)   r*   __doc____annotations__r   r4   r7   r9   rA   r   r   r   r    r+   %   s   
 r+   )	metaclass)
__future__r   sysabcr   r   collections.abcr   r   typesr   typingr   r	   r
   r   r   version_infor   r   typing_extensions_core._tasksr   r   r   r   r   r+   r   r   r   r    <module>   s     
