← back to Atmos Game

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

100 lines

�

c�bj�)����UddlmZddlZddlZddlmZmZddlmZm	Z	m
Z
mZmZddl
mZddlmZddlmZddlmZmZmZdd	lmZmZmZmZmZmZej:d
k\r	ddlmZmZnddl mZmZerDddl!m"Z"d
dl#m$Z$m%Z%m&Z&m'Z'd
dl(m)Z)d
dl*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ed�Z;edd��Z<ed�Z=e>e?zee>zee?zZ@deAd<Gd�de��ZBy) �)�annotationsN)�ABCMeta�abstractmethod)�
AsyncIterator�	Awaitable�Callable�	Coroutine�Sequence)�AbstractContextManager)�PathLike)�Signals)�
AddressFamily�
SocketKind�socket)�IO�
TYPE_CHECKING�Any�	TypeAlias�TypeVar�overload)��)�TypeVarTuple�Unpack)�FileDescriptorLike�)�CapacityLimiter�Event�Lock�	Semaphore)�CancelScope)�TaskInfo�)�ConnectedUDPSocket�ConnectedUNIXDatagramSocket�IPSockAddrType�SocketListener�SocketStream�	UDPSocket�UNIXDatagramSocket�UNIXSocketStream)�Process)�	TaskGroup)�
TestRunner�T_Retval�T_coT)�	covariant�PosArgsTr�StrOrBytesPathc�J�eZdZee										d6d���Zeed7d���Zeed8d���Zeed9d���Zeed:d���Z	ed:d��Z
ed:d��Zeed;d���Zeee
jd	d
�					d<d���Zeed8d���Zeed=d
���Zeed>d���Zeed?d���Zeedd	d�							d@d���ZeedAd���Zee		dB									dCd���Zeed:d���Zee								dDd���Zee								dEd���Zee												dFd���ZeedGd���Zee	dH							dId���ZeedJd���ZeedKd���ZeedKd���Zee										dLd���Z ee!						dMd���Z"ee!						dNd ���Z"ee						dOd!���Z"eed"d"d"d"d#�													dPd$���Z#ee	dQ					dRd%���Z$eedSd&���Z%eedSd'���Z&eedSd(���Z'eedKd)���Z(eedTd*���Z)eedUd+���Z*eedVd,���Z+eedWd-���Z,eedXd.���Z-ee				dYd/���Z.eedZd0���Z/ee				d[d1���Z0eed\d2���Z1eed]d3���Z2eed:d4���Z3eed^d5���Z4y)_�AsyncBackendc��y)a�
        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 kwargs: positional arguments to ``func``
        :param options: keyword arguments to call the backend ``run()`` implementation
            with
        :return: the return value of the coroutine function
        N�)�cls�func�args�kwargs�optionss     �k/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/anyio/abc/_eventloop.py�runzAsyncBackend.run4���c��y)z�
        Return an object that allows other threads to run code inside the event loop.

        :return: a token object, specific to the event loop running in the current
            thread
        Nr7�r8s r=�
current_tokenzAsyncBackend.current_tokenJr?r@c��y)zz
        Return the current value of the event loop's internal clock.

        :return: the clock value (seconds)
        Nr7rBs r=�current_timezAsyncBackend.current_timeTr?r@c��y)zFReturn the exception class that is raised in a task if it's cancelled.Nr7rBs r=�cancelled_exception_classz&AsyncBackend.cancelled_exception_class]r?r@c��K�y�w)z�
        Check if the task has been cancelled, and allow rescheduling of other tasks.

        This is effectively the same as running :meth:`checkpoint_if_cancelled` and then
        :meth:`cancel_shielded_checkpoint`.
        Nr7rBs r=�
checkpointzAsyncBackend.checkpointb�������c��K�|j�tjk(r|j��d{���yy7��w)z�
        Check if the current task group has been cancelled.

        This will check if the task has been cancelled, but will not allow other tasks
        to be scheduled if not.

        N)�current_effective_deadline�math�infrIrBs r=�checkpoint_if_cancelledz$AsyncBackend.checkpoint_if_cancelledls7�����)�)�+����y�8��.�.�"�"�"�9�"�s�6A�?�Ac��K�|jd��5|jd��d{���ddd�y7�
#1swYyxYw�w)z�
        Allow the rescheduling of other tasks.

        This will give other tasks the opportunity to run, but without checking if the
        current task group has been cancelled, unlike with :meth:`checkpoint`.

        T)�shieldrN)�create_cancel_scope�sleeprBs r=�cancel_shielded_checkpointz'AsyncBackend.cancel_shielded_checkpointxs>�����
$�
$�D�
$�
1��)�)�A�,���2�
1���2�
1�s$�A�:�8�:�	A�:�A�Ac��K�y�w)zt
        Pause the current task for the specified duration.

        :param delay: the duration, in seconds
        Nr7)r8�delays  r=rTzAsyncBackend.sleep�rJrKF)�deadlinerRc��y�Nr7)r8rXrRs   r=rSz AsyncBackend.create_cancel_scope����
	
r@c��y)aQ
        Return the nearest deadline among all the cancel scopes effective for the
        current task.

        :return:
            - a clock value from the event loop's internal clock
            - ``inf`` if there is no deadline in effect
            - ``-inf`` if the current scope has been cancelled
        :rtype: float
        Nr7rBs r=rMz'AsyncBackend.current_effective_deadline�r?r@c��yrZr7rBs r=�create_task_groupzAsyncBackend.create_task_group����	
r@c��yrZr7rBs r=�create_eventzAsyncBackend.create_event�r_r@c��yrZr7)r8�fast_acquires  r=�create_lockzAsyncBackend.create_lock�r_r@N)�	max_valuercc��yrZr7)r8�
initial_valuerercs    r=�create_semaphorezAsyncBackend.create_semaphore�s��	
r@c��yrZr7)r8�total_tokenss  r=�create_capacity_limiterz$AsyncBackend.create_capacity_limiter�r_r@c��K�y�wrZr7)r8r9r:�abandon_on_cancel�limiters     r=�run_sync_in_worker_threadz&AsyncBackend.run_sync_in_worker_thread������	
�rKc��yrZr7rBs r=�check_cancelledzAsyncBackend.check_cancelled�r_r@c��yrZr7�r8r9r:�tokens    r=�run_async_from_threadz"AsyncBackend.run_async_from_thread����	
r@c��yrZr7rts    r=�run_sync_from_threadz!AsyncBackend.run_sync_from_thread�rwr@c��K�y�wrZr7)r8�command�stdin�stdout�stderrr;s      r=�open_processzAsyncBackend.open_process�s����	
�rKc��yrZr7)r8�workerss  r=�#setup_process_pool_exit_at_shutdownz0AsyncBackend.setup_process_pool_exit_at_shutdown�r_r@c��K�y�wrZr7)r8�host�port�
local_addresss    r=�connect_tcpzAsyncBackend.connect_tcp������
	
�rKc��K�y�wrZr7)r8�paths  r=�connect_unixzAsyncBackend.connect_unix������	
�rKc��yrZr7�r8�socks  r=�create_tcp_listenerz AsyncBackend.create_tcp_listenerr_r@c��yrZr7r�s  r=�create_unix_listenerz!AsyncBackend.create_unix_listenerr_r@c��K�y�wrZr7)r8�familyr��remote_address�
reuse_ports     r=�create_udp_socketzAsyncBackend.create_udp_socket
rprKc��K�y�wrZr7�r8�
raw_socket�remote_paths   r=�create_unix_datagram_socketz(AsyncBackend.create_unix_datagram_sockets����!�rKc��K�y�wrZr7r�s   r=r�z(AsyncBackend.create_unix_datagram_sockets����'*�rKc��K�y�wrZr7r�s   r=r�z(AsyncBackend.create_unix_datagram_socket$r�rKr)r��type�proto�flagsc��K�y�wrZr7)r8r�r�r�r�r�r�s       r=�getaddrinfozAsyncBackend.getaddrinfo+s����(	
�rKc��K�y�wrZr7)r8�sockaddrr�s   r=�getnameinfozAsyncBackend.getnameinfoAr�rKc��K�y�wrZr7�r8�objs  r=�
wait_readablezAsyncBackend.wait_readableHr�rKc��K�y�wrZr7r�s  r=�
wait_writablezAsyncBackend.wait_writableMr�rKc��yrZr7r�s  r=�notify_closingzAsyncBackend.notify_closingRr_r@c��K�y�wrZr7r�s  r=�wrap_listener_socketz!AsyncBackend.wrap_listener_socketWr�rKc��K�y�wrZr7r�s  r=�wrap_stream_socketzAsyncBackend.wrap_stream_socket\r�rKc��K�y�wrZr7r�s  r=�wrap_unix_stream_socketz$AsyncBackend.wrap_unix_stream_socketar�rKc��K�y�wrZr7r�s  r=�wrap_udp_socketzAsyncBackend.wrap_udp_socketfr�rKc��K�y�wrZr7r�s  r=�wrap_connected_udp_socketz&AsyncBackend.wrap_connected_udp_socketkr�rKc��K�y�wrZr7r�s  r=�wrap_unix_datagram_socketz&AsyncBackend.wrap_unix_datagram_socketpr�rKc��K�y�wrZr7r�s  r=�#wrap_connected_unix_datagram_socketz0AsyncBackend.wrap_connected_unix_datagram_socketur�rKc��yrZr7rBs r=�current_default_thread_limiterz+AsyncBackend.current_default_thread_limiter|r_r@c��yrZr7)r8�signalss  r=�open_signal_receiverz!AsyncBackend.open_signal_receiver�r[r@c��yrZr7rBs r=�get_current_taskzAsyncBackend.get_current_task�r_r@c��yrZr7rBs r=�get_running_taskszAsyncBackend.get_running_tasks�r_r@c��K�y�wrZr7rBs r=�wait_all_tasks_blockedz#AsyncBackend.wait_all_tasks_blocked�r�rKc��yrZr7)r8r<s  r=�create_test_runnerzAsyncBackend.create_test_runner�r_r@)
r9z1Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]]r:�tuple[Unpack[PosArgsT]]r;�dict[str, Any]r<r��returnr/)r��object)r��float)r�ztype[BaseException])r��None)rWr�r�r�)rXr�rR�boolr�r!)r�r-)r�r)rcr�r�r)rg�intrez
int | Nonercr�r�r )rjr�r�r)FN)
r9�&Callable[[Unpack[PosArgsT]], T_Retval]r:r�rmr�rnzCapacityLimiter | Noner�r/)r9z7Callable[[Unpack[PosArgsT]], Coroutine[Any, Any, T_co]]r:r�rur�r�r0)r9r�r:r�rur�r�r/)r{z)StrOrBytesPath | Sequence[StrOrBytesPath]r|�int | IO[Any] | Noner}r�r~r�r;rr�r,)r�zset[Process]r�r�rZ)r��strr�r�r��IPSockAddrType | Noner�r()r��str | bytesr�r+)r�rr�r')
r�rr�r�r�r�r�r�r�zUDPSocket | ConnectedUDPSocket)r�rr�r�r�r*)r�rr�r�r�r%)r�rr�zstr | bytes | Noner�z0UNIXDatagramSocket | ConnectedUNIXDatagramSocket)r�zbytes | str | Noner�zstr | int | Noner�zint | AddressFamilyr�zint | SocketKindr�r�r�r�r�zuSequence[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]])r)r�r&r�r�r�ztuple[str, str])r�rr�r�)r�rr�r()r�rr�r+)r�rr�r))r�rr�r$)r�rr�r*)r�rr�r%)r�r)r�r
r�z.AbstractContextManager[AsyncIterator[Signals]])r�r")r�zSequence[TaskInfo])r<r�r�r.)5�__name__�
__module__�__qualname__�classmethodrr>rCrErGrIrPrUrTrNrOrSrMr^rardrhrkrorrrvryrr�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r7r@r=r5r53s{�����?��&���	�
 ��
�
����(��������������U���U��������	#��	#��	��	���������"&�(�(�5�
��
�48�
�	�
���
�
��
���
���
���
���
���
���
���
���
!%�"�
��
��	
�
�
�
�

���
���
���
���
#(�*.�
�4�
�&�
� �	
�
(�
�
�

���
���
���
���
�E�
�&�
��	
�

�
���
���
�4�
�&�
��	
�

�
���
���	
�:�	
�$�		
�
%�	
�%�
	
��	
�
�	
���	
���
���
���JN�
��
�!�
�2G�
�	�
���
�
��
���
���
���
���
���
���
��
�-�
�.�	
�
�
�
(�

���
��
�!��!�.2�!�	�!���!��
�*��*�.9�*�	$�*���*���
��
�.@�
�	9�
���
�
��'(�!"���
� �
��
�
$�
��

��
��
�
�
���
�(��45�
�%�
�.1�
�	�
���
�
��
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
���
��
�	$�
���
�
��
���
���
��
�	7�
���
�
��
���
���
���
���
���
���
���
r@r5)�	metaclass)C�
__future__rrN�sys�abcrr�collections.abcrrrr	r
�
contextlibr�osr�signalr
rrr�typingrrrrrr�version_inforr�typing_extensions�	_typeshedr�_core._synchronizationrrrr �_core._tasksr!�_core._testingr"�_socketsr$r%r&r'r(r)r*r+�
_subprocessesr,�_tasksr-�_testingr.r/r0r2r��bytesr3�__annotations__r5r7r@r=�<module>r�s���"��
�'�S�S�-���4�4������w��+�+�6��,�P�P�*�)�	�	�	�'�!�$��:����v��&���
�#���%�K�(�3�-�7�(�5�/�I��	�I�g
�W�g
r@