Format: application/x-python-code
⬇ Download File (2.8 KB)
   1  o
   2  
   3  ;'hF�@shddlmZddlmZmZddlmZmZddlm	Z	Gdd�d�Z
   4  dd	d
   5  �Zddd
   6  �Zddd�Z
   7  dS)�)�annotations)�	Awaitable�	Generator)�Any�cast�)�get_async_backendc@sFeZdZdZdZddd�Zddd�Zddd�Zddd�Zddd�Z	dS) �TaskInfoaI
   8      Represents an asynchronous task.
   9  
  10      :ivar int id: the unique identifier of the task
  11      :ivar parent_id: the identifier of the parent task, if any
  12      :vartype parent_id: Optional[int]
  13      :ivar str name: the description of the task (if any)
  14      :ivar ~collections.abc.Coroutine coro: the coroutine object of the task
  15      )�_name�id�	parent_id�name�coror�intr�
  16  int | Noner
  17  �
  18  str | Noner�)Generator[Any, Any, Any] | Awaitable[Any]cCs4t}|j�d|j��|_||_||_||_||_dS)N�.)�get_current_task�
  19  __module__�__qualname__r
  20  rrr
  21  r)�selfrrr
  22  r�func�r�JC:\Users\shubh\Videos\agent\nova\Lib\site-packages\anyio/_core/_testing.py�__init__s
  23  zTaskInfo.__init__�other�object�return�boolcCst|t�r|j|jkStS�N)�
  24  isinstancer	r�NotImplemented)rrrrr�__eq__$s
  25  zTaskInfo.__eq__cCs
  26  t|j�Sr )�hashr�rrrr�__hash__*s
  27  zTaskInfo.__hash__�strcCs|jj�d|j�d|j�d�S)Nz(id=z, name=�))�	__class__�__name__rr
  28  r%rrr�__repr__-szTaskInfo.__repr__cCsdS)z_
  29          Return ``True`` if the task has a cancellation pending, ``False`` otherwise.
  30  
  31          Frr%rrr�has_pending_cancellation0sz!TaskInfo.has_pending_cancellationN)rrrrr
  32  rrr)rrrr)rr)rr')rr)
  33  r*rr�__doc__�	__slots__rr#r&r+r,rrrrr		s
  34  
  35  
  36  
  37  
  38  r	rcCs
  39  t���S)zV
  40      Return the current task.
  41  
  42      :return: a representation of the current task
  43  
  44      )rrrrrrr8s
  45  r�list[TaskInfo]cCstdt����S)zn
  46      Return a list of running tasks in the current event loop.
  47  
  48      :return: a list of task info objects
  49  
  50      r/)rr�get_running_tasksrrrrr0Bsr0�Nonec�s�t���IdHdS)z5Wait until all other tasks are waiting for something.N)r�wait_all_tasks_blockedrrrrr2Ls�r2N)rr	)rr/)rr1)�
  51  __future__r�collections.abcrr�typingrrZ
  52  _eventlooprr	rr0r2rrrr�<module>s
  53  /
  54  
  55  
  56