Edit File: timeouts.cpython-311.opt-1.pyc
� �����f������������������������������d�dl�Z�d�dlmZ�d�dlmZmZmZ�ddlmZ�ddlm Z �ddlm Z �dZ�G�d ��d e�j��������������������Z e�G�d��d��������������������������Zd ee���������defd�Zdee���������defd�ZdS�)�����N)� TracebackType)�final�Optional�Type����)�events)� exceptions)�tasks)�Timeout�timeout� timeout_atc��������������������"�����e�Zd�ZdZdZdZdZdZdS�)�_State�created�active�expiring�expired�finishedN)�__name__� __module__�__qualname__�CREATED�ENTERED�EXPIRING�EXPIRED�EXITED��������7/opt/alt/python311/lib64/python3.11/asyncio/timeouts.pyr���r������s'���������������G��G��H��G� �F�F�Fr���r���c������������ ��������������e�Zd�ZdZdee���������ddfd�Zdee���������fd�Zdee���������ddfd�Zde fd�Z defd �Zdd �Z deee������������������dee���������d ee���������dee ���������fd�Zdd�ZdS�)r���z�Asynchronous context manager for cancelling overdue coroutines. Use `timeout()` or `timeout_at()` rather than instantiating this class directly. �when�returnNc������������������R�����t�����������j��������|�_��������d|�_��������d|�_��������||�_��������dS�)z�Schedule a timeout that will trigger at a given loop time. - If `when` is `None`, the timeout will never trigger. - If `when < loop.time()`, the timeout will trigger on the next iteration of the event loop. N)r���r����_state�_timeout_handler�_task�_when)�selfr!���s��� r����__init__zTimeout.__init__!���s'��������n���>B���+/�� ��� � � r���c�����������������������|�j���������S�)zReturn the current deadline.)r'����r(���s��� r���r!���zTimeout.when.���s �������z�r���c�����������������������|�j���������t����������j��������ur?|�j���������t����������j��������u�rt ����������d�������������t ����������d|�j���������j����������d��������������||�_��������|�j���������|�j��������������������������������������������|� d|�_��������dS�t����������j ����������������������}||�����������������������������������k����r!|���������������������|�j ��������������������|�_��������dS�|���������������������||�j ��������������������|�_��������dS�)zReschedule the timeout.zTimeout has not been enteredzCannot change state of z TimeoutN)r$���r���r���r����RuntimeError�valuer'���r%����cancelr����get_running_loop�time� call_soon�_on_timeout�call_at)r(���r!����loops��� r���� reschedulezTimeout.reschedule2���s��������;�f�n�,�,��{�f�n�,�,�"�#A�B�B�B��E�$�+�*;�E�E�E����� ���� �� �,��!�(�(�*�*�*��<�$(�D�!�!�!��*�,�,�D��t�y�y�{�{�"�"�(,���t�7G�(H�(H��%�%�%�(,���T�4�;K�(L�(L��%�%�%r���c������������������@�����|�j���������t����������j��������t����������j��������fv�S�)z$Is timeout expired during execution?)r$���r���r���r���r+���s��� r���r���zTimeout.expiredI���s�������{�v����?�?�?r���c������������������������dg}|�j���������t����������j��������u�r6|�j���������t ����������|�j��������d������������nd�}|���������������������d|����������������d���������������������|������������}d|�j���������j����������d|��d�S�)N������zwhen=� z <Timeout [�]�>)r$���r���r���r'����round�append�joinr.���)r(����infor!����info_strs��� r����__repr__zTimeout.__repr__M���sz�������t���;�&�.�(�(�+/�:�+A�5���Q�'�'�'�t�D��K�K�����'�'�'��8�8�D�>�>��;�D�K�-�;�;��;�;�;�;r���c�������������������6��K����|�j���������t����������j��������urt����������d�������������t ����������j����������������������}|�t����������d�������������t����������j��������|�_���������||�_��������|�j�������������������������������������������|�_ ��������|�� ��������������������|�j���������������������|�S�)Nz Timeout has already been enteredz$Timeout should be used inside a task)r$���r���r���r-���r ����current_taskr���r&���� cancelling�_cancellingr6���r'���)r(����tasks��� r���� __aenter__zTimeout.__aenter__U���s������������;�f�n�,�,��A�B�B�B��!�#�#���<��E�F�F�F��n����� ��:�0�0�2�2������� �#�#�#��r����exc_type�exc_val�exc_tbc�������������������Z��K����|�j���������� |�j���������������������������������������������d�|�_���������|�j��������t����������j��������u�rJt����������j��������|�_��������|�j�������������������������������������������|�j��������k����r|t����������j ��������u�rt����������|�n$|�j��������t����������j��������u�rt����������j ��������|�_��������d�S��N)r%���r/���r$���r���r���r���r&����uncancelrG���r ����CancelledError�TimeoutErrorr���r���)r(���rJ���rK���rL���s��� r���� __aexit__zTimeout.__aexit__a���s������������� �,��!�(�(�*�*�*�$(�D�!��;�&�/�)�)� �.�D�K��z�"�"�$�$��(8�8�8�X��Ib�=b�=b��#��/�� �[�F�N� *� *� �-�D�K��tr���c������������������h�����|�j���������������������������������������������t����������j��������|�_��������d�|�_��������d�S�rN���)r&���r/���r���r���r$���r%���r+���s��� r���r3���zTimeout._on_timeouty���s-������� �������o��� $����r���)r"���r���)r"���N)r���r���r����__doc__r����floatr)���r!���r6����boolr����strrC���rI���r���� BaseExceptionr���rR���r3���r���r���r���r���r������sD���������������� �X�e�_�������������h�u�o���������M�x����M�4��M��M��M��M�.@���@��@��@��@�<�#��<��<��<��<� �� �� �� ���4� �.�/����-�(�����'� � � �$���������0%��%��%��%��%��%r���r����delayr"���c������������������x�����t����������j����������������������}t����������|��|�����������������������������������|�z���nd������������S�)a ��Timeout async context manager. Useful in cases when you want to apply timeout logic around block of code or in cases when asyncio.wait_for is not suitable. For example: >>> async with asyncio.timeout(10): # 10 seconds timeout ... await long_running_task() delay - value in seconds or None to disable timeout logic long_running_task() is interrupted by raising asyncio.CancelledError, the top-most affected timeout() context manager converts CancelledError into TimeoutError. N)r���r0���r���r1���)rY���r5���s��� r���r���r�������s7������ ��"�$�$�D��%�*;�4�9�9�;�;��&�&��F�F�Fr���r!���c������������������ �����t����������|�������������S�)ab��Schedule the timeout at absolute time. Like timeout() but argument gives absolute time in the same clock system as loop.time(). Please note: it is not POSIX time but a time with undefined starting base, e.g. the time of the system power on. >>> async with asyncio.timeout_at(loop.time() + 10): ... await long_running_task() when - a deadline when timeout occurs or None to disable timeout logic long_running_task() is interrupted by raising asyncio.CancelledError, the top-most affected timeout() context manager converts CancelledError into TimeoutError. )r���)r!���s��� r���r ���r �������s������&��4�=�=�r���)�enum�typesr����typingr���r���r���r9���r���r ���r ����__all__�Enumr���r���rU���r���r ���r���r���r����<module>ra������s@����������������������(��(��(��(��(��(��(��(��(��(������������������������������������������������T�Y���������c%��c%��c%��c%��c%��c%��c%����c%�LG�8�E�?��G�w��G��G��G��G�(�X�e�_���������������r���