ó
    ùÞ jž  ã                   óŠ   • S SK r 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  \
" S5      r\(       a  S SKJr   " S S5      rg)	é    N)Úsleep)ÚTYPE_CHECKINGÚAnyÚCallableÚIterableÚTupleÚTypeÚTypeVar)ÚConnectionErrorÚTimeoutErrorÚT)ÚAbstractBackoffc            	       ó¨   • \ rS rSrSr\\\R                  44SSS\	S\
\\   S4   4S jjrS	\\\      S
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Ú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.
N©Ú_backoffÚ_retriesÚ_supported_errors)Úselfr   r   r   s       ÚE/var/www/html/gaurav/venv/lib/python3.13/site-packages/redis/retry.pyÚ__init__ÚRetry.__init__   s   € ð"  ŒØŒØ!1Õó    Úspecified_errorsÚreturnNc                 ó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Úfailc                 ó>  • U R                   R                  5         Sn  U" 5       $ ! U R                   ad  nUS-  nU" U5        U R                  S:¼  a  X0R                  :”  a  UeU R                   R	                  U5      nUS:”  a  [        U5         SnAOSnAff = fM�  )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�   € ð 	�‰×ÑÔØˆØð	#Ù“t�øØ×)Ñ)ó #Ø˜A‘�Ù�U”Ø—=‘= AÓ%¨(·]±]Ó*BØ�KØŸ-™-×/Ñ/°Ó9�Ø˜Q“;Ü˜'”Nÿøð#úñ s   Ÿ& ¦B¶ABÂBr   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   ÚsocketÚtimeoutÚintr   r	   Ú	Exceptionr   r   r$   r   r   r   r.   Ú__static_attributes__© r   r   r   r      s›   † Ù:ð ØØ�N‰Nð9
ñ	2à"ð2ð ð2ð    Y¡°Ð 4Ñ5õ	2ð*
Ø (¨¨i©Ñ 9ð
à	ô
ð#à�R˜�U‰Oð#ð ˜	�{ CÐ'Ñ(ð#ð 
÷	#r   r   )r5   Útimer   Útypingr   r   r   r   r   r	   r
   Úredis.exceptionsr   r   r   Úredis.backoffr   r   r:   r   r   Ú<module>r?      s0   ðÛ Ý ß O× OÑ Oç :áˆCƒL€æÝ-÷9#ò 9#r   