a
    ø£Beé	  ã                   @  s¢   d dl m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rdd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 )é    )Úannotations)ÚABCMetaÚabstractmethod)Ú	AwaitableÚCallable)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚProtocolÚTypeVarÚoverloadé   )ÚCancelScopeÚT_RetvalÚT_contraT)Úcontravariantc                   @  sF   e Zd Zedddœdd„ƒZedddœdd„ƒZdd
ddœdd„Zd	S )Ú
TaskStatuszTaskStatus[None]ÚNone)ÚselfÚreturnc                 C  s   d S ©N© ©r   r   r   úS/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/anyio/abc/_tasks.pyÚstarted   s    zTaskStatus.startedr   )Úvaluer   c                 C  s   d S r   r   ©r   r   r   r   r   r      s    NzT_contra | Nonec                 C  s   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      s    )N)Ú__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dd	œd
d„ƒZeddœddddd	œdd„ƒZed dœdd„ƒZedddd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   Zcancel_scopeN)ÚnamezCallable[..., Awaitable[Any]]Úobjectr   )ÚfuncÚargsr!   r   c                G  s   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   r#   r!   r$   r   r   r   Ú
start_soon*   s    zTaskGroup.start_soonr	   c                Ç  s   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   Ústart;   s    zTaskGroup.start)r   c                 Ã  s   dS )z:Enter the task group context and allow starting new tasks.Nr   r   r   r   r   Ú
__aenter__O   s    zTaskGroup.__aenter__ztype[BaseException] | NonezBaseException | NonezTracebackType | Nonezbool | None)Úexc_typeÚexc_valÚexc_tbr   c                 Ã  s   dS )z<Exit the task group context waiting for all tasks to finish.Nr   )r   r)   r*   r+   r   r   r   Ú	__aexit__S   s    zTaskGroup.__aexit__)
r   r   r   Ú__doc__Ú__annotations__r   r&   r'   r(   r,   r   r   r   r   r        s   
üür    )Ú	metaclassN)Ú
__future__r   Úabcr   r   Úcollections.abcr   r   Útypesr   Útypingr   r	   r
   r   r   Z_core._tasksr   r   r   r   r    r   r   r   r   Ú<module>   s   