
    ng\j	                         S SK Jr  S SKJrJrJrJrJrJrJ	r	J
r
Jr  S SKJrJrJr  S SKJr  \
" S5      r\(       a  S SKJr   " S S\\   5      rg	)
    )sleep)	TYPE_CHECKINGAny	AwaitableCallableOptionalTupleTypeTypeVarUnion)ConnectionError
RedisErrorTimeoutError)AbstractRetryT)AbstractBackoffc                      ^  \ rS rSr\R
                  r\\44SSS\S\	\
\   S4   4U 4S jjjrS\S	\4S
 jr  SS\/ \\   4   S\\\/\4   \\\/\4   4   S\\\/\4      S\S	\4
S jjrSrU =r$ )Retry   backoffr   retriessupported_errors.c                 &   > [         TU ]  XU5        g N)super__init__)selfr   r   r   	__class__s       N/home/edenadmin/noVNC/venv/lib/python3.13/site-packages/redis/asyncio/retry.pyr   Retry.__init__   s     	+;<    otherreturnc                    [        U[        5      (       d  [        $ U R                  UR                  :H  =(       aK    U R                  UR                  :H  =(       a+    [        U R                  5      [        UR                  5      :H  $ r   )
isinstancer   NotImplemented_backoff_retriesset_supported_errors)r   r"   s     r   __eq__Retry.__eq__%   sf    %''!! MMU^^+ L/LD**+s53J3J/KK	
r!   dofailis_retryablewith_failure_countc                   #    U R                   R                  5         Sn  U" 5       I Sh  vN $  N! U R                   a  nU(       a  U" U5      (       d  e US-  nU(       a  U" Xe5      I Sh  vN    OU" U5      I Sh  vN    U R                  S:  a  XPR                  :  a  UeU R                   R	                  U5      nUS:  a  [        U5      I Sh  vN     SnAOSnAff = fM  7f)a  
Execute an operation that might fail and returns its result, or
raise the exception that was thrown depending on the `Backoff` object.
`do`: the operation to call. Expects no argument.
`fail`: the failure handler, expects the last error that was thrown
``is_retryable``: optional function to determine if an error is retryable
``with_failure_count``: if True, the failure count is passed to the failure handler
r   N   )r'   resetr*   r(   computer   )r   r-   r.   r/   r0   failureserrorr   s           r   call_with_retryRetry.call_with_retry/   s     $ 	)Tz!z)) )U(;(;A%u///u+%%==A%(]]*BK--//9Q;.(() s\   C+
2 02 C+2 C&,C!.A1/C! BAC!CC!C+!C&&C+ )NF)__name__
__module____qualname____firstlineno__r   __hash__r   r   intr	   r
   r   r   r   boolr+   r   r   r   r   	Exceptionr   r7   __static_attributes____classcell__)r   s   @r   r   r      s    %%H :
		="	= 	=  Z 0# 56		= 	=
C 
D 
" ?C#(%)R1%&%) i[#%&i%s*+-
%) xT(9:;%) !%) 
%) %)r!   r   N)asyncior   typingr   r   r   r   r   r	   r
   r   r   redis.exceptionsr   r   r   redis.retryr   r   redis.backoffr   r   r9   r!   r   <module>rI      sC    
 
 
 G F %CL-=)M*% =)r!   