
    hF                    h    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y)    )annotations)	Awaitable	Generator)Anycast   )get_async_backendc                  L    e Zd ZdZdZ	 	 	 	 	 	 	 	 d	dZd
dZddZddZddZ	y)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coroc                    t         }|j                   d|j                   | _        || _        || _        || _        || _        y )N.)get_current_task
__module____qualname__r   r   r   r   r   )selfr   r   r   r   funcs         9D:\jyotish\venv\Lib\site-packages\anyio/_core/_testing.py__init__zTaskInfo.__init__   sC      ($*;*;)<=
%. $	?C	    c                `    t        |t              r| j                  |j                  k(  S t        S N)
isinstancer   r   NotImplemented)r   others     r   __eq__zTaskInfo.__eq__$   s%    eX&77ehh&&r   c                ,    t        | j                        S r   )hashr   r   s    r   __hash__zTaskInfo.__hash__*   s    DGG}r   c                h    | j                   j                   d| j                  d| j                  dS )Nz(id=z, name=))	__class____name__r   r   r#   s    r   __repr__zTaskInfo.__repr__-   s.    ..))*$twwkQOOr   c                     y)z_
        Return ``True`` if the task has a cancellation pending, ``False`` otherwise.

        F r#   s    r   has_pending_cancellationz!TaskInfo.has_pending_cancellation0   s    
 r   N)r   intr   z
int | Noner   z
str | Noner   z)Generator[Any, Any, Any] | Awaitable[Any])r   objectreturnbool)r/   r-   )r/   str)r/   r0   )
r(   r   r   __doc__	__slots__r   r    r$   r)   r,   r+   r   r   r   r   	   sS     ;IDD D 	D
 8DPr   r   c                 2    t               j                         S )zV
    Return the current task.

    :return: a representation of the current task

    )r	   r   r+   r   r   r   r   8   s     //11r   c                 F    t        dt               j                               S )zn
    Return a list of running tasks in the current event loop.

    :return: a list of task info objects

    list[TaskInfo])r   r	   get_running_tasksr+   r   r   r7   r7   B   s      "3"5"G"G"IJJr   c                 P   K   t               j                          d{    y7 w)z5Wait until all other tasks are waiting for something.N)r	   wait_all_tasks_blockedr+   r   r   r9   r9   L   s     


4
4
666s   &$&N)r/   r   )r/   r6   )r/   None)
__future__r   collections.abcr   r   typingr   r   
_eventloopr	   r   r   r7   r9   r+   r   r   <module>r?      s,    " 0  ), ,^2K7r   