o
    #6d                     @  sl   d dl mZ d dlmZmZmZ ddlmZmZ ddl	m
Z
 G dd dZdd	d
ZdddZdddZdS )    )annotations)Any	Awaitable	Generator   )DeprecatedAwaitableList_warn_deprecation)get_asynclibc                   @  sP   e Zd ZdZdZdddZdddZd ddZd!ddZd"ddZ	d#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                 C  s4   t }|j d|j | _|| _|| _|| _|| _d S )N.)get_current_task
__module____qualname__r   r   r   r   r   )selfr   r   r   r   func r   kC:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\anyio/_core/_testing.py__init__   s   
zTaskInfo.__init__otherobjectreturnboolc                 C  s   t |tr| j|jkS tS N)
isinstancer
   r   NotImplemented)r   r   r   r   r   __eq__$   s   
zTaskInfo.__eq__c                 C  s
   t | jS r!   )hashr   r   r   r   r   __hash__*   s   
zTaskInfo.__hash__strc                 C  s   | j j d| jd| jdS )Nz(id=z, name=))	__class____name__r   r   r&   r   r   r   __repr__-   s   zTaskInfo.__repr__Generator[None, None, TaskInfo]c                 c  s    t |  	 | S r!   )r   r&   r   r   r   	__await__0   s   zTaskInfo.__await__c                 C  s   | S r!   r   r&   r   r   r   _unwrap7   s   zTaskInfo._unwrapN)r   r   r   r   r   r   r   r   )r   r   r   r    )r   r   )r   r(   )r   r-   r   r
   )r+   r   r   __doc__	__slots__r   r$   r'   r,   r.   r/   r   r   r   r   r
   	   s    





r
   r   c                   C  s
   t   S )zV
    Return the current task.

    :return: a representation of the current task

    )r	   r   r   r   r   r   r   ;   s   
r   !DeprecatedAwaitableList[TaskInfo]c                  C  s   t   } t| tdS )zn
    Return a list of running tasks in the current event loop.

    :return: a list of task info objects

    )r   )r	   get_running_tasksr   )tasksr   r   r   r4   E   s   
r4   Nonec                     s   t   I dH  dS )z5Wait until all other tasks are waiting for something.N)r	   wait_all_tasks_blockedr   r   r   r   r7   P   s   r7   Nr0   )r   r3   )r   r6   )
__future__r   typingr   r   r   Z_compatr   r   Z
_eventloopr	   r
   r   r4   r7   r   r   r   r   <module>   s    
2

