§
    ø¦¹b  ã                   óD   — d dl Z d dlmZ d dlmZmZ  G d„ d¦  «        ZdS )é    N)Úsleep)ÚConnectionErrorÚTimeoutErrorc                   ó>   — e Zd ZdZeeej        ffd„Zde	fd„Z
d„ ZdS )ÚRetryz0Retry a specific number of times after a failurec                 ó0   — || _         || _        || _        dS )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)ÚselfÚbackoffÚretriesÚsupported_errorss       ú-/usr/lib/python3/dist-packages/redis/retry.pyÚ__init__zRetry.__init__
   s    € ð  ˆŒØˆŒØ!1ˆÔÐÐó    Úspecified_errorsc                 ór   — t          t          | j        t          |¦  «        z   ¦  «        ¦  «        | _        dS )zM
        Updates the supported errors with the specified error types
        N)ÚtupleÚsetr   )r   r   s     r   Úupdate_supported_errorszRetry.update_supported_errors   s8   € õ "'Ý�Ô&­Ð/?Ñ)@Ô)@Ñ@ÑAÔAñ"
ô "
ˆÔÐÐr   c                 ó.  — | j                              ¦   «          d}	 	  |¦   «         S # | j        $ ra}|dz  } ||¦  «         | j        dk    r|| j        k    r|‚| j                              |¦  «        }|dk    rt          |¦  «         Y d}~nd}~ww xY wŒz)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   Té   N)r	   Úresetr   r
   Úcomputer   )r   ÚdoÚfailÚfailuresÚerrorr   s         r   Úcall_with_retryzRetry.call_with_retry#   s»   € ð 	Œ×ÒÑÔÐØˆð
	#ð	#Ø�r‘t”t�øØÔ)ð #ð #ð #Ø˜A‘�Ø��U‘”�Ø”= AÒ%Ð%¨(°T´]Ò*BÐ*BØ�KØœ-×/Ò/°Ñ9Ô9�Ø˜Q’;�;Ý˜'‘N”N�Nøøøøøøøøøð#øøøð
	#s   ž	( ¨
B²ABÂBN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚsocketÚtimeoutr   Úlistr   r    © r   r   r   r      sf   € € € € € Ø:Ð:ð *¨<¸¼ÐHð	2ð 2ð 2ð 2ð"
¸ð 
ð 
ð 
ð 
ð#ð #ð #ð #ð #r   r   )r%   Útimer   Úredis.exceptionsr   r   r   r(   r   r   ú<module>r+      sj   ðØ €€€Ø Ð Ð Ð Ð Ð à :Ð :Ð :Ð :Ð :Ð :Ð :Ð :ð/#ð /#ð /#ð /#ð /#ñ /#ô /#ð /#ð /#ð /#r   