
    phX                         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  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TupleTypeTypeVar)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\/ \\   4   S\\/\4   S	\4S 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       M/home/james-whalen/.local/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failc                 ~  #    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= )__name__
__module____qualname____firstlineno__r   __hash__r   r   intr   r	   r   r   r   boolr)   r   r   r   r3   __static_attributes____classcell__)r   s   @r   r   r      s    %%H :
		="	= 	=  Z 0# 56		= 	=
C 
D 
)2y|+,)4<j\3=N4O)	
) )r   r   N)asyncior   typingr   r   r   r   r   r	   r
   redis.exceptionsr   r   r   redis.retryr   r   redis.backoffr   r   r5   r   r   <module>rD      s:     P P P F F %CL--)M*% -)r   