Ë
    êU.jž  ã                   ó€   — d dl Z d dlmZ d dlmZmZmZmZmZm	Z	m
Z
 d dlmZmZ  e
d«      Zerd dlmZ  G d„ d«      Zy)	é    N)Úsleep)ÚTYPE_CHECKINGÚAnyÚCallableÚIterableÚTupleÚTypeÚTypeVar)ÚConnectionErrorÚTimeoutErrorÚT)ÚAbstractBackoffc            	       ó˜   — e Zd ZdZeeej                  ffdddede	e
e   df   fd„Zdee
e      d	d
fd„Zdeg ef   deegef   d	efd„Zy
)ÚRetryz0Retry a specific number of times after a failureÚbackoffr   ÚretriesÚsupported_errors.c                 ó.   — || _         || _        || _        y)a'  
        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       úMC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\redis/retry.pyÚ__init__zRetry.__init__   s   € ð"  ˆŒØˆŒØ!1ˆÕó    Úspecified_errorsÚreturnNc                 ób   — t        t        | j                  t        |«      z   «      «      | _        y)zM
        Updates the supported errors with the specified error types
        N)ÚtupleÚsetr   )r   r   s     r   Úupdate_supported_errorszRetry.update_supported_errors%   s*   € ô "'Ü�×&Ñ&¬Ð/?Ó)@Ñ@ÓAó"
ˆÕr   ÚdoÚfailc                 ó6  — | j                   j                  «        d}	 	  |«       S # | j                  $ rb}|dz  } ||«       | j                  dk\  r|| j                  kD  r|‚| j                   j	                  |«      }|dkD  rt        |«       Y d}~nd}~ww xY wŒ})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
        r   é   N)r   Úresetr   r   Úcomputer   )r   r"   r#   ÚfailuresÚerrorr   s         r   Úcall_with_retryzRetry.call_with_retry/   s’   € ð 	�‰×ÑÔØˆØð	#Ù“t�øØ×)Ñ)ò #Ø˜A‘�Ù�U”Ø—=‘= AÒ%¨(°T·]±]Ò*BØ�KØŸ-™-×/Ñ/°Ó9�Ø˜Q’;Ü˜'”Nÿøð#úð s   Ÿ& ¦BµABÂB)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚsocketÚtimeoutÚintr   r	   Ú	Exceptionr   r   r!   r   r   r   r*   © r   r   r   r      s›   „ Ù:ð ØØ�N‰Nð9
ñ	2à"ð2ð ð2ð    Y¡°Ð 4Ñ5ó	2ð*
Ø (¨¨i©Ñ 9ð
à	ó
ð#à�R˜�U‰Oð#ð ˜	�{ CÐ'Ñ(ð#ð 
ô	#r   r   )r/   Útimer   Útypingr   r   r   r   r   r	   r
   Úredis.exceptionsr   r   r   Úredis.backoffr   r   r3   r   r   Ú<module>r8      s0   ðÛ Ý ß O× OÑ Oç :áˆCƒL€áÝ-÷9#ò 9#r   