Your IP : 3.145.164.205


Current Path : /opt/alt/python313/lib64/python3.13/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/asyncio/__pycache__/timeouts.cpython-313.opt-1.pyc

�

1}g�����SSKrSSKJr SSKJrJrJr SSKJr SSKJ	r	 SSKJ
r
 Sr"S	S
\R5r
\"SS55rS
\\S\4SjrS\\S\4Sjrg)�N)�
TracebackType)�final�Optional�Type�)�events)�
exceptions)�tasks)�Timeout�timeout�
timeout_atc�(�\rSrSrSrSrSrSrSrSr	g)	�_State��created�active�expiring�expired�finished�N)
�__name__�
__module__�__qualname__�__firstlineno__�CREATED�ENTERED�EXPIRING�EXPIRED�EXITED�__static_attributes__r��7/opt/alt/python313/lib64/python3.13/asyncio/timeouts.pyrrs���G��G��H��G�
�Fr!rc	���\rSrSrSrS\\SS4SjrS\\4SjrS\\SS4Sjr	S\
4S	jrS\4S
jr
SSjrS\\\S
\\S\\S\\
4SjrSSjr\S
\SS4Sj5rSrg)r�z�Asynchronous context manager for cancelling overdue coroutines.

Use `timeout()` or `timeout_at()` rather than instantiating this class directly.
�when�returnNc�V�[RUlSUlSUlXlg)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)rr�_state�_timeout_handler�_task�_when)�selfr%s  r"�__init__�Timeout.__init__!s#���n�n���>B���+/��
��
r!c��UR$)zReturn the current deadline.)r+�r,s r"r%�Timeout.when.s���z�z�r!c��UR[RLaKUR[RLa[	S5e[	SURR
S35eXlURbURR5 UcSUlg[R"5nXR5::a!URUR5UlgURXR5Ulg)zReschedule the timeout.zTimeout has not been enteredzCannot change state of z TimeoutN)r(rrr�RuntimeError�valuer+r)�cancelr�get_running_loop�time�	call_soon�_on_timeout�call_at)r,r%�loops   r"�
reschedule�Timeout.reschedule2s����;�;�f�n�n�,��{�{�f�n�n�,�"�#A�B�B��)�$�+�+�*;�*;�)<�H�E��
��
�� � �,��!�!�(�(�*��<�$(�D�!��*�*�,�D��y�y�{�"�(,���t�7G�7G�(H��%�(,���T�;K�;K�(L��%r!c�\�UR[R[R4;$)z$Is timeout expired during execution?)r(rrrr0s r"r�Timeout.expiredIs���{�{�v������?�?�?r!c��S/nUR[RLa9URb[	URS5OSnURSU35 SR
U5nSURRSUS3$)N��zwhen=� z
<Timeout [�]�>)r(rrr+�round�append�joinr4)r,�infor%�info_strs    r"�__repr__�Timeout.__repr__Mss���t���;�;�&�.�.�(�+/�:�:�+A�5����Q�'�t�D��K�K�%��v��'��8�8�D�>���D�K�K�-�-�.�a��z��;�;r!c��N# �UR[RLa[S5e[R
"5nUc[S5e[RUlXlURR5Ul	URUR5 U$7f)Nz Timeout has already been enteredz$Timeout should be used inside a task)r(rrr3r
�current_taskrr*�
cancelling�_cancellingr<r+)r,�tasks  r"�
__aenter__�Timeout.__aenter__Usz����;�;�f�n�n�,��A�B�B��!�!�#���<��E�F�F��n�n����
��:�:�0�0�2�������
�
�#���s�B#B%�exc_type�exc_val�exc_tbc��n# �URb!URR5 SUlUR[RLa�[R
UlURR5UR::avUbs[U[R5(a[UeUbJURU5 [U[5(a$URHnURU5 M gUR[R La[R"Ulg7f�N)r)r5r(rrrr*�uncancelrP�
issubclassr	�CancelledError�TimeoutError�_insert_timeout_error�
isinstance�ExceptionGrouprr)r,rTrUrV�excs     r"�	__aexit__�Timeout.__aexit__as����� � �,��!�!�(�(�*�$(�D�!��;�;�&�/�/�)� �.�.�D�K��z�z�"�"�$��(8�(8�8�X�=Q��h�
�(A�(A�B�B�&�G�3��(��.�.�w�7�!�'�>�:�:�#*�#5�#5�C� �6�6�s�;�$6�
��[�[�F�N�N�
*� �-�-�D�K��s�D3D5c�p�URR5 [RUlSUlgrX)r*r5rrr(r)r0s r"r9�Timeout._on_timeouts%���
�
�����o�o��� $��r!c��URbn[UR[R5(a)[	5nUR=UlUlXlgURnURbMmggrX)�__context__r^r	r[r\�	__cause__)rU�tes  r"r]�Timeout._insert_timeout_error�sd���!�!�-��'�-�-�z�/H�/H�I�I�!�^��07�0C�0C�C�����&(�#���)�)�G�
�!�!�-r!)rPr(r*r)r+)r&r)r&N)rrrr�__doc__r�floatr-r%r<�boolr�strrKrRr�
BaseExceptionrrar9�staticmethodr]r rr!r"rrs����
�X�e�_�����h�u�o��M�x���M�4�M�.@��@�<�#�<�
���4�
�.�/���-�(����'�	�

�$���<%��*�}�*��*��*r!r�delayr&c�v�[R"5n[UbUR5U-5$S5$)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)rr6rr7)rpr;s  r"rr�s5�� �"�"�$�D��%�*;�4�9�9�;��&�F�F��F�Fr!r%c��[U5$)a6Schedule 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�typingrrrrArr	r
�__all__�Enumrrrkrr
rr!r"�<module>rxs����(�(�������T�Y�Y���s*�s*��s*�lG�8�E�?�G�w�G�(�X�e�_���r!

?>