21#_ߟ. 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 defdZdee defdZdS ) N)
TracebackType)finalOptionalType )events)
exceptions)tasks)Timeouttimeout
timeout_atc " e Zd ZdZdZdZdZdZdS )_StatecreatedactiveexpiringexpiredfinishedN)__name__
__module____qualname__CREATEDENTEREDEXPIRINGEXPIREDEXITED =/opt/alt/python-internal/lib64/python3.11/asyncio/timeouts.pyr r s' GGHG
FFFr r c e Zd ZdZdee ddfdZdee fdZdee ddfdZde fdZ
defd Zdd
Z
deee dee d
ee dee fdZddZdS )r zAsynchronous context manager for cancelling overdue coroutines.
Use `timeout()` or `timeout_at()` rather than instantiating this class directly.
whenreturnNc R t j | _ d| _ d| _ || _ dS )zSchedule 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
zr 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 RuntimeErrorvaluer' r% cancelr get_running_looptime call_soon_on_timeoutcall_at)r( r! loops r
reschedulezTimeout.reschedule2 s ;fn,,{fn,,"#ABBBE$+*;EEE
,!((***<$(D!!!*,,Dtyy{{""(,t7G(H(H%%%(,T4;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| dS )N zwhen= z