Ë
    êU.j«  ã                   ó|   — 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mZ erd dlmZ  e	d«      Z G d„ d«      Zy)	é    )Úsleep)ÚTYPE_CHECKINGÚAnyÚ	AwaitableÚCallableÚTupleÚTypeÚTypeVar)ÚConnectionErrorÚ
RedisErrorÚTimeoutError)ÚAbstractBackoffÚTc            	       ó|   — e Zd ZdZdZeeffdddedee	e
   df   fd„Zd	efd
„Zdeg ee   f   dee
gef   defd„Zy)ÚRetryz0Retry a specific number of times after a failure©Ú_backoffÚ_retriesÚ_supported_errorsÚ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.
        Nr   )Úselfr   r   r   s       úUC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\redis/asyncio/retry.pyÚ__init__zRetry.__init__   s   € ð   ˆŒØˆŒØ!1ˆÕó    Úspecified_errorsc                 ó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ÚfailÚreturnc              ƒ   óv  K  — | j                   j                  «        d}	 	  |«       ƒ d{  –—† S 7 Œ# | j                  $ rt}|dz  } ||«      ƒ d{  –—†7   | j                  dk\  r|| j                  kD  r|‚| j                   j	                  |«      }|dkD  rt        |«      ƒ d{  –—†7   Y d}~nd}~ww xY wŒ™­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—zÐ!�zùØ×)Ñ)ò )Ø˜A‘�Ù˜5“k×!Ñ!Ø—=‘= AÒ%¨(°T·]±]Ò*BØ�KØŸ-™-×/Ñ/°Ó9�Ø˜Q’;Ü ›.×(Ñ(ÿøð)úð ùsP   ‚B9¡
2 «0¬2 ¯B9°2 ²B5ÁB0ÁAÁAB0Â%B(Â&B0Â+B9Â0B5Â5B9N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   Úintr   r	   r   r   Úlistr"   r   r   r   r   r,   © r   r   r   r      sŠ   „ Ù:à;€Ið Øð:
ñ	2à"ð2ð ð2ð    ZÑ 0°#Ð 5Ñ6ó	2ð(
¸ó 
ð)Ø˜2˜y¨™|Ð+Ñ,ð)Ø4<¸j¸\È3Ð=NÑ4Oð)à	
ô)r   r   N)Úasyncior   Útypingr   r   r   r   r   r	   r
   Úredis.exceptionsr   r   r   Úredis.backoffr   r   r   r4   r   r   Ú<module>r9      s2   ðÝ ß P× PÑ Pç FÑ FáÝ-ñ ˆCƒL€÷6)ò 6)r   