← back to Atmos Game
assets/gen/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_testing.cpython-312.pyc
45 lines
�
c�bj$ � �h � d dl mZ d dlmZmZ d dlmZmZ ddlm Z G d� d� Z
dd�Zd
d �Zdd
�Z
y)� )�annotations)� Awaitable� Generator)�Any�cast� )�get_async_backendc �L � e Zd ZdZdZ d d�Zd
d�Zdd�Zdd�Zd
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 �k/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/anyio/_core/_testing.py�__init__zTaskInfo.__init__ sC � � �����(��$�*;�*;�)<�=��
����%.��� $�� �?C�� � c �` � t |t � r| j |j k( S t S �N)�
isinstancer r
�NotImplemented)r �others r �__eq__zTaskInfo.__eq__$ s% � ��e�X�&��7�7�e�h�h�&�&��r c �, � t | j � S r )�hashr
�r s r �__hash__zTaskInfo.__hash__* s � ��D�G�G�}�r c �h � | j j � d| j �d| j �d�S )Nz(id=z, name=�))� __class__�__name__r
r r# s r �__repr__zTaskInfo.__repr__- s. � ��.�.�)�)�*�$�t�w�w�k�����
�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 )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 r+ r r r r 8 s � � ��/�/�1�1r c �F � t dt � j � � 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
�list[TaskInfo])r r �get_running_tasksr+ r r r7 r7 D s � � � �"3�"5�"G�"G�"I�J�Jr c � �P K � t � j � � d{ ��� y7 ��w)z5Wait until all other tasks are waiting for something.N)r �wait_all_tasks_blockedr+ r r r9 r9 P s � �� �
�
�
4�
4�
6�6�6�s �&�$�&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