← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/anyio/_core/__pycache__/_eventloop.cpython-312.pyc

79 lines

�

c�bj����UddlmZddlZddlZddlZddlmZmZmZddl	m
Z
ddlmZddl
mZddlmZmZmZdd	lmZej*d
k\r	ddlmZmZnddlmZmZded
<	ddlZerddlmZdZed�Zed�Z ejB�Z"iZ#ded<ddd�									d$d�Z$d%d�Z%d&d�Z&d'd�Z'd(d�Z(d)d�Z)d)d�Z*d*d�Z+e
						d+d��Z,d,d-d �Z-d.d!�Z.d/d"�Z/d0d#�Z0y#e$rdZY��wxYw)1�)�annotationsN)�	Awaitable�Callable�	Generator)�contextmanager)�Token)�
import_module)�
TYPE_CHECKING�Any�TypeVar�)�NoEventLoopError)��)�TypeVarTuple�Unpackr�sniffio�)�AsyncBackend)�asyncio�trio�T_Retval�PosArgsTzdict[str, type[AsyncBackend]]�loaded_backendsr)�backend�backend_optionsc�P�t�x}rtd|�d���	t|�}d}|�t
|�}	|xsi}|j||i|�t|�S#t$r/}|tvrtd|�d|�d��|�td|���|�d}~wwxYw#t|�wxYw)u�
    Run the given coroutine function in an asynchronous event loop.

    The current thread must not be already running an event loop.

    :param func: a coroutine function
    :param args: positional arguments to ``func``
    :param backend: name of the asynchronous event loop implementation – currently
        either ``asyncio`` or ``trio``
    :param backend_options: keyword arguments to call the backend ``run()``
        implementation with (documented :ref:`here <backend options>`)
    :return: the return value of the coroutine function
    :raises RuntimeError: if an asynchronous event loop is already running in this
        thread
    :raises LookupError: if the named backend is not found

    zAlready running z in this threadzBackend z6 is not available. Install it with: pip install anyio[�]zNo such backend: N)	�current_async_library�RuntimeError�get_async_backend�ImportError�BACKENDS�LookupError�set_current_async_library�run�reset_current_async_library)�funcrr�args�
asynclib_name�
async_backend�exc�tokens        �m/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/anyio/_core/_eventloop.pyr&r&&s���..�/�/�}�/��-�m�_�O�L�M�M�	B�)�'�2�
�
�E���*�'�2��+�)�/�R��� � ��t�R��A�#�E�*��'�B��h����7�+�&6�6=�Y�a�A���
�
�-�g�Y�7�8�c�A��B��&	$�E�*�s"�A�B�	B�&*B�B�
B%c��PK�t�j|��d{���S7��w)zi
    Pause the current task for the specified duration.

    :param delay: the duration, in seconds

    N)r!�sleep)�delays r.r0r0Xs"����#�$�*�*�5�1�1�1�1�s�&�$�&c��RK�ttj��d{���y7��w)z�
    Pause the current task until it's cancelled.

    This is a shortcut for ``sleep(math.inf)``.

    .. versionadded:: 3.1

    N)r0�math�inf��r.�
sleep_foreverr7bs��������/���s�'�%�'c��dK�t�}tt||z
d���d{���y7��w)z�
    Pause the current task until the given time.

    :param deadline: the absolute time to wake up at (according to the internal
        monotonic clock of the event loop)

    .. versionadded:: 3.1

    rN)�current_timer0�max)�deadline�nows  r.�sleep_untilr=ns(�����.�C�
��H�s�N�A�&�
'�'�'�s�&0�.�0c�2�t�j�S)z�
    Return the current value of the event loop's internal clock.

    :return: the clock value (seconds)
    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread

    )r!r9r5r6r.r9r9|s����+�+�-�-r6c��tS)z5Return a tuple of the names of all built-in backends.)r#r5r6r.�get_all_backendsr@�s���Or6c��g}t�D]}	t|�|j|��!t	|�S#t$rY�8wxYw)z�
    Test for the availability of built-in backends.

    :return a tuple of the built-in backend names that were successfully imported

    .. versionadded:: 4.12

    )r@r!r"�append�tuple)�available_backends�backend_names  r.�get_available_backendsrF�sV��%'��(�*��	��l�+�	�!�!�,�/�
+��#�$�$���	��	�s�:�	A�Ac�2�t�j�S)z�
    Return the current async library's cancellation exception class.

    :raises NoEventLoopError: if no supported asynchronous event loop is running in the
        current thread

    )r!�cancelled_exception_classr5r6r.�get_cancelled_exc_classrI�s����8�8�:�:r6c#�hK�ddlm}|||�t_	d��t`y#t`wxYw�w)Nr)�EventLoopToken)�lowlevelrK�threadlocals�
current_token)�
backend_classr-rKs   r.�claim_worker_threadrP�s.����*�!/�
�u�!E�L��'�
��&��L�&�s�2�'�2�/�2c���|�1t�}|s%tddjt������	t|S#t
$r0t
d|���}|jt|<|jcYSwxYw)NzPNot currently running on any asynchronous event loop. Available async backends: z, zanyio._backends._)rr�joinr@r�KeyErrorr	rO)r*�modules  r.r!r!�s�����-�/�
��"�-�-1�Y�Y�7G�7I�-J�,K�M��
�$��}�-�-���$��!2�=�/�B�C��)/�)=�)=��
�&��#�#�#�$�s�>�6A7�6A7c��t�ddl}	|j�y	tj�S#t$rYywxYw#tj
$rYywxYw)Nrr)rr�get_running_loopr r�AsyncLibraryNotFoundError)rs r.rr�sg�����	��$�$�&��	��0�0�2�2��	�	���	��
�0�0�	���	�s�2�A�	>�>�A�Ac�N�t�ytjj|�S�N)r�current_async_library_cvar�set)r*s r.r%r%�s!������-�-�1�1�-�@�@r6c�H�|� tjj|�yyrY)rrZ�reset)r-s r.r'r'�s!�����*�*�0�0��7�r6)
r(z1Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]]r)zUnpack[PosArgsT]r�strrzdict[str, Any] | None�returnr)r1�floatr_�None)r_ra)r;r`r_ra)r_r`)r_ztuple[str, ...])r_ztype[BaseException])rO�type[AsyncBackend]r-�objectr_zGenerator[Any, None, None]rY)r*�
str | Noner_rb)r_rd)r*rdr_�Token | None)r-rer_ra)1�
__future__rr3�sys�	threading�collections.abcrrr�
contextlibr�contextvarsr�	importlibr	�typingr
rr�_exceptionsr�version_inforr�typing_extensions�__annotations__r�ModuleNotFoundError�abcrr#rr�localrMrr&r0r7r=r9r@rFrIrPr!rr%r'r5r6r.�<module>rus@��"��
��:�:�%��#�.�.�)����w��+�+�6�	�����"����:����
�#���y��� ��13��.�3��-1�	/+�
;�/+��/+��/+�+�	/+�
�/+�d2�	�(�	.��
%�*;� �	'�%�	'�.4�	'��	'��	'�$�(�&A�8��q���G��s�&C*�*C4�3C4