
    f j$	                    p    d dl mZ d dlmZmZ d dlmZmZ ddlm	Z	  G d d          Z
dd	ZddZddZdS )    )annotations)	Awaitable	Generator)Anycast   )get_async_backendc                  >    e Zd ZdZdZddZddZddZddZddZ	dS )TaskInfoaI  
    Represents an asynchronous task.

    :ivar int id: the unique identifier of the task
    :ivar parent_id: the identifier of the parent task, if any
    :vartype parent_id: Optional[int]
    :ivar str name: the description of the task (if any)
    :ivar ~collections.abc.Coroutine coro: the coroutine object of the task
    )_nameid	parent_idnamecoror   intr   
int | Noner   
str | Noner   )Generator[Any, Any, Any] | Awaitable[Any]c                x    t           }|j         d|j         | _        || _        || _        || _        || _        d S )N.)get_current_task
__module____qualname__r   r   r   r   r   )selfr   r   r   r   funcs         hC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\anyio/_core/_testing.py__init__zTaskInfo.__init__   sC      ==$*;==
%. $	?C			    otherobjectreturnboolc                Z    t          |t                    r| j        |j        k    S t          S N)
isinstancer   r   NotImplemented)r   r   s     r   __eq__zTaskInfo.__eq__$   s)    eX&& 	'7eh&&r   c                *    t          | j                  S r$   )hashr   r   s    r   __hash__zTaskInfo.__hash__*   s    DG}}r   strc                @    | j         j         d| j        d| j        dS )Nz(id=z, name=))	__class____name__r   r   r*   s    r   __repr__zTaskInfo.__repr__-   s*    .)OOtwOOOOOOr   c                    dS )z_
        Return ``True`` if the task has a cancellation pending, ``False`` otherwise.

        F r*   s    r   has_pending_cancellationz!TaskInfo.has_pending_cancellation0   s	    
 ur   N)r   r   r   r   r   r   r   r   )r   r    r!   r"   )r!   r   )r!   r,   )r!   r"   )
r0   r   r   __doc__	__slots__r   r'   r+   r1   r4   r3   r   r   r   r   	   s          ;ID D D D      P P P P     r   r   r!   c                 B    t                                                      S )z
    Return the current task.

    :return: a representation of the current task
    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread

    )r	   r   r3   r   r   r   r   8   s     //111r   list[TaskInfo]c                 ^    t          dt                                                                S )z
    Return a list of running tasks in the current event loop.

    :return: a list of task info objects
    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread

    r8   )r   r	   get_running_tasksr3   r   r   r:   r:   D   s(      "3"5"5"G"G"I"IJJJr   Nonec                 V   K   t                                                       d{V  dS )z5Wait until all other tasks are waiting for something.N)r	   wait_all_tasks_blockedr3   r   r   r=   r=   P   s6      



4
4
6
6666666666r   N)r!   r   )r!   r8   )r!   r;   )
__future__r   collections.abcr   r   typingr   r   
_eventloopr	   r   r   r:   r=   r3   r   r   <module>rB      s    " " " " " " 0 0 0 0 0 0 0 0         ) ) ) ) ) ), , , , , , , ,^	2 	2 	2 	2	K 	K 	K 	K7 7 7 7 7 7r   