
    Ii                         S SK Jr  S SKJrJrJrJrJrJrJ	r	  S SK
JrJrJr  \(       a  S SKJr  \	" S5      r " S S5      rg)	    )sleep)TYPE_CHECKINGAny	AwaitableCallableTupleTypeTypeVar)ConnectionError
RedisErrorTimeoutError)AbstractBackoffTc            	           \ rS rSrSrSr\\44SSS\S\	\
\   S4   4S	 jjrS
\4S jrS\/ \\   4   S\\/\4   S\4S jrSrg)Retry   z0Retry a specific number of times after a failure_backoff_retries_supported_errorsbackoffr   retriessupported_errors.c                 (    Xl         X l        X0l        g)z
Initialize a `Retry` object with a `Backoff` object
that retries a maximum of `retries` times.
`retries` can be negative to retry forever.
You can specify the types of supported errors which trigger
a retry with the `supported_errors` parameter.
Nr   )selfr   r   r   s       9/venv/lib/python3.13/site-packages/redis/asyncio/retry.py__init__Retry.__init__   s       !1    specified_errorsc                 b    [        [        U R                  [        U5      -   5      5      U l        g)z=
Updates the supported errors with the specified error types
N)tuplesetr   )r   r    s     r   update_supported_errorsRetry.update_supported_errors&   s*     "'&&/?)@@A"
r   dofailreturnc                 ~  #    U R                   R                  5         Sn  U" 5       I Sh  vN $  N! U R                   av  nUS-  nU" U5      I Sh  vN    U R                  S:  a  X0R                  :  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)z
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
r   N   )r   resetr   r   computer   )r   r&   r'   failureserrorr   s         r   call_with_retryRetry.call_with_retry.   s      		)Tz!z)) )A5k!!==A%(]]*BK--//9Q;.(() sP   B=
2 02 B=2 B8B3AAB3(B+)B3.B=3B88B=N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   intr   r	   r   r   listr$   r   r   r   r   r/   __static_attributes__ r   r   r   r      s    :;I :
	2"2 2  Z 0# 56	2(
 
)2y|+,)4<j\3=N4O)	
)r   r   N)asyncior   typingr   r   r   r   r   r	   r
   redis.exceptionsr   r   r   redis.backoffr   r   r   r:   r   r   <module>r?      s2     P P P F F- CL6) 6)r   