ó
    ùÞ jöþ  ã                   óú  • % S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  S SKJrJrJr  S SKJr  S SKJr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JrJ r J!r!J"r"J#r#  S	S
K$J%r%J&r&J'r'J(r(  S	SK)J*r*  S	SK+J,r,  S	SK-J.r.J/r/  S	SK0J1r1J2r2  S	SK3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;  S	SK<J=r=  S	SK>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrG  \@(       a  S SKHrHSrISrJSrKSrLSrM\N" 5       rO\\\'\(\&4      \PS'   \@(       a  \&rQO\'rQ " S S5      rR " S S5      rS " S S5      rT " S S\T5      rU " S  S!\U5      rV " S" S#\T5      rW " S$ S%\V5      rX " S& S'\U5      rYS(rZS) r[\\\]\]\[\[\^\\\\\[\]S*.
r_S+ r`\" S,S-S.9ra " S/ S-5      rb " S0 S1\b5      rcg)2é    N)Úabstractmethod)Úchain)ÚEmptyÚFullÚ	LifoQueue)Útime)ÚAnyÚCallableÚDictÚListÚOptionalÚTypeÚTypeVarÚUnion)Úparse_qsÚunquoteÚurlparse)Ú
CacheEntryÚCacheEntryStatusÚCacheFactoryÚCacheFactoryInterfaceÚCacheInterfaceÚCacheKeyé   )ÚEncoderÚ_HiredisParserÚ_RESP2ParserÚ_RESP3Parser)ÚTokenInterface)Ú	NoBackoff)ÚCredentialProviderÚ"UsernamePasswordCredentialProvider)ÚAfterConnectionReleasedEventÚEventDispatcher)ÚAuthenticationErrorÚ$AuthenticationWrongNumberOfArgsErrorÚChildDeadlockedErrorÚConnectionErrorÚ	DataErrorÚ
RedisErrorÚResponseErrorÚTimeoutError)ÚRetry)	ÚCRYPTOGRAPHY_AVAILABLEÚHIREDIS_AVAILABLEÚSSL_AVAILABLEÚcompare_versionsÚdeprecated_argsÚensure_stringÚformat_error_messageÚget_lib_versionÚstr_if_bytesó   *ó   $s   
ó    é   ÚDefaultParserc                   ó"   • \ rS rSrS\4S jrSrg)ÚHiredisRespSerializeréG   Úargsc                 ó¾  • / n[        US   [        5      (       a1  [        US   R                  5       R	                  5       5      USS -   nO+SUS   ;   a"  [        US   R	                  5       5      USS -   n UR                  [        R                  " U5      5        U$ ! [         a3    [        R                  " 5       u  p4n[        U5      R                  U5      ef = f©ú2Pack a series of arguments into the Redis protocolr   r   Nó    )Ú
isinstanceÚstrÚtupleÚencodeÚsplitÚappendÚhiredisÚpack_commandÚ	TypeErrorÚsysÚexc_infor)   Úwith_traceback)Úselfr?   ÚoutputÚ_ÚvalueÚ	tracebacks         ÚJ/var/www/html/gaurav/venv/lib/python3.13/site-packages/redis/connection.pyÚpackÚHiredisRespSerializer.packH   sÅ   € àˆä�d˜1‘gœs×#Ñ#Ü˜˜a™Ÿ™Ó)×/Ñ/Ó1Ó2°T¸!¸"°XÑ=‰DØ�T˜!‘W‹_Ü˜˜a™Ÿ™›Ó)¨D°°¨HÑ4ˆDð	=Ø�M‰Mœ'×.Ò.¨tÓ4Ô5ð
 ˆøô	 ó 	=Ü"%§,¢,£.ÑˆA�iÜ˜EÓ"×1Ñ1°)Ó<Ð<ð	=ús   Á8%B Â=C© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   rV   Ú__static_attributes__rX   r9   rU   r=   r=   G   s   † ð˜$÷ r9   r=   c                   ó$   • \ rS rSrSS jrS rSrg)ÚPythonRespSerializeréY   Nc                 ó   • Xl         X l        g ©N©Ú_buffer_cutoffrG   )rP   Úbuffer_cutoffrG   s      rU   Ú__init__ÚPythonRespSerializer.__init__Z   s   € Ø+ÔØ�r9   c           	      óŽ  • / n[        US   [        5      (       a1  [        US   R                  5       R	                  5       5      USS -   nO+SUS   ;   a"  [        US   R	                  5       5      USS -   n[
        R                  [        [        [        U5      5      R                  5       [        45      nU R                  n[        U R                  U5       H×  n[        U5      n[        U5      U:”  d  Xd:”  d  [        U[        5      (       ab  [
        R                  U[        [        U5      R                  5       [        45      nUR                  U5        UR                  U5        [        nM™  [
        R                  U[        [        U5      R                  5       [        U[        45      nMÙ     UR                  U5        U$ rA   )rD   rE   rF   rG   rH   Ú	SYM_EMPTYÚjoinÚSYM_STARÚlenÚSYM_CRLFrd   ÚmapÚ
memoryviewÚ
SYM_DOLLARrI   )rP   r?   rQ   Úbuffre   ÚargÚ
arg_lengths          rU   rV   ÚPythonRespSerializer.pack^   sh  € àˆô �d˜1‘gœs×#Ñ#Ü˜˜a™Ÿ™Ó)×/Ñ/Ó1Ó2°T¸!¸"°XÑ=‰DØ�T˜!‘W‹_Ü˜˜a™Ÿ™›Ó)¨D°°¨HÑ4ˆDä�~‰~œx¬¬S°«Y«×)>Ñ)>Ó)@Ä(ÐKÓLˆà×+Ñ+ˆÜ�t—{‘{ DÖ)ˆCô ˜S›ˆJä�D“	˜MÓ)ØÓ-Ü˜c¤:×.Ñ.ä —~‘~Øœ:¤s¨:£×'=Ñ'=Ó'?ÄÐJó�ð —‘˜dÔ#Ø—‘˜cÔ"Ü’ä —~‘~àÜ"Ü˜J›×.Ñ.Ó0Ü ØÜ ðó	’ñ! *ð4 	�‰�dÔØˆr9   rc   ©ÚreturnN)rY   rZ   r[   r\   rf   rV   r]   rX   r9   rU   r_   r_   Y   s   † ôõ+r9   r_   c                   ó„  • \ rS rSr\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       r\S
 5       r\SS j5       r\S 5       r\SS j5       r\ SSSS.S jj5       r\S 5       r\S 5       r\\S\\\\4   \\\4   4   4S j5       5       r\S\4S j5       r\S 5       rSrg)ÚConnectionInterfaceéŒ   c                 ó   • g rb   rX   ©rP   s    rU   Úrepr_piecesÚConnectionInterface.repr_pieces�   ó   € àr9   c                 ó   • g rb   rX   ©rP   Úcallbacks     rU   Úregister_connect_callbackÚ-ConnectionInterface.register_connect_callback‘   r~   r9   c                 ó   • g rb   rX   r€   s     rU   Úderegister_connect_callbackÚ/ConnectionInterface.deregister_connect_callback•   r~   r9   c                 ó   • g rb   rX   ©rP   Úparser_classs     rU   Ú
set_parserÚConnectionInterface.set_parser™   r~   r9   c                 ó   • g rb   rX   r{   s    rU   Úget_protocolÚ ConnectionInterface.get_protocol�   r~   r9   c                 ó   • g rb   rX   r{   s    rU   ÚconnectÚConnectionInterface.connect¡   r~   r9   c                 ó   • g rb   rX   r{   s    rU   Ú
on_connectÚConnectionInterface.on_connect¥   r~   r9   c                 ó   • g rb   rX   ©rP   r?   s     rU   Ú
disconnectÚConnectionInterface.disconnect©   r~   r9   c                 ó   • g rb   rX   r{   s    rU   Úcheck_healthÚ ConnectionInterface.check_health­   r~   r9   Tc                 ó   • g rb   rX   ©rP   Úcommandrš   s      rU   Úsend_packed_commandÚ'ConnectionInterface.send_packed_command±   r~   r9   c                 ó   • g rb   rX   ©rP   r?   Úkwargss      rU   Úsend_commandÚ ConnectionInterface.send_commandµ   r~   r9   c                 ó   • g rb   rX   ©rP   Útimeouts     rU   Úcan_readÚConnectionInterface.can_read¹   r~   r9   F©Údisconnect_on_errorÚpush_requestc                ó   • g rb   rX   )rP   Údisable_decodingr¬   r­   s       rU   Úread_responseÚ!ConnectionInterface.read_response½   s   € ð 	r9   c                 ó   • g rb   rX   r–   s     rU   rK   Ú ConnectionInterface.pack_commandÇ   r~   r9   c                 ó   • g rb   rX   ©rP   Úcommandss     rU   Úpack_commandsÚ!ConnectionInterface.pack_commandsË   r~   r9   rv   c                 ó   • g rb   rX   r{   s    rU   Úhandshake_metadataÚ&ConnectionInterface.handshake_metadataÏ   s   € ð 	r9   Útokenc                 ó   • g rb   rX   ©rP   r¼   s     rU   Úset_re_auth_tokenÚ%ConnectionInterface.set_re_auth_tokenÔ   r~   r9   c                 ó   • g rb   rX   r{   s    rU   Úre_authÚConnectionInterface.re_authØ   r~   r9   rX   N©T©r   ©F)rY   rZ   r[   r\   r   r|   r‚   r…   rŠ   r�   r�   r“   r—   rš   rŸ   r¤   r©   r°   rK   r·   Úpropertyr   r   ÚbytesrE   rº   r   r¿   rÂ   r]   rX   r9   rU   rx   rx   Œ   s«  † Øñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð ñó ðð óó ðð ñó ðð óó ðð ð ðð !Øõó ðð ñó ðð ñó ðð Øð E¨$¨u°e¨|Ñ*<¸dÀ3ÈÀ8¹nÐ*LÑ$Mó ó ó ðð ð ~ó ó ðð ñó ór9   rx   c            *       ó€  • \ rS rSrSrSSSSS\SSS\SSSS	\" 5       SSSSS
SS4S\S\	\
   S\	\   S\	\   S\S\
S\
S\S\S\S\	\
   S\	\
   S\	\
   S\	\
   S\\S4   S\	\/ S4      S\	\   S\	\   S\	\/ S4      S\	\   4(S jjrS  r\S! 5       rS" rS# rS$ rS% rS& rS' r\S( 5       r\S) 5       rS* rS+ rS, r S- r!S. r"S/ r#SAS1 jr$S2 r%SBS3 jr& SCS0SS4.S5 jjr'S6 r(S7 r)S8\=(       d    \
4S9 jr*\+S8\\,\-\-4   \,\
\
4   4   4S: j5       r.\.R^                  S;\\,\-\-4   \,\
\
4   4   4S< j5       r.S=\04S> jr1S? r2S@r3g)DÚAbstractConnectionéÝ   z0Manages communication to and from a Redis serverr   NFúutf-8Ústricti   zredis-pyr:   ÚdbÚpasswordÚsocket_timeoutÚsocket_connect_timeoutÚretry_on_timeoutÚencodingÚencoding_errorsÚdecode_responsesÚsocket_read_sizeÚhealth_check_intervalÚclient_nameÚlib_nameÚlib_versionÚusernameÚretryÚredis_connect_funcÚcredential_providerÚprotocolÚcommand_packerÚevent_dispatcherc                 óR  • U(       d  U(       a  Ub  [        S5      eUc  [        5       U l        OUU l        [        R                  " 5       U l        Xl        XÐl        Xàl        Xðl	        UU l
        X l        UU l        X0l        Uc  UnX@l        XPl        U[         L a  / nU(       a  UR#                  [$        5        X`l        U(       d  U(       aT  Uc  [)        [+        5       S5      U l        O[.        R0                  " U5      U l        U R,                  R3                  U5        O[)        [+        5       S5      U l        XÀl        SU l        UU l        [;        XxU	5      U l        SU l        SU l         X°l!        U RE                  U
5        / U l#        SU l$        SU l%         [M        U5      nUS:  d  US:”  a  [U        S	5      eUU l+        U RY                  U5      U l-        g! [N         a	    [P        n NG[R         a    [U        S5      ef = f! WS:  d  US:”  a  [U        S	5      eUU l+        f = f)
a  
Initialize a new Connection.
To specify a retry policy for specific errors, first set
`retry_on_error` to a list of the error/s to retry on, then set
`retry` to a valid `Retry` object.
To retry on TimeoutError, `retry_on_timeout` can also be set to `True`.
NzÂ'username' and 'password' cannot be passed along with 'credential_provider'. Please provide only one of the following arguments: 
1. 'password' and (optional) 'username'
2. 'credential_provider'r   r   ip  zprotocol must be an integerr:   é   zprotocol must be either 2 or 3).r)   r$   Ú_event_dispatcherÚosÚgetpidÚpidrÎ   rØ   rÙ   rÚ   rÞ   rÏ   rÛ   rÐ   rÑ   rÒ   ÚSENTINELrI   r,   Úretry_on_errorr-   r    rÜ   ÚcopyÚdeepcopyÚupdate_supported_errorsr×   Únext_health_checkrÝ   r   Úencoderrº   Ú_sockÚ_socket_read_sizerŠ   Ú_connect_callbacksrd   Ú_re_auth_tokenÚintrL   ÚDEFAULT_RESP_VERSIONÚ
ValueErrorr(   rß   Ú_construct_command_packerÚ_command_packer)rP   rÎ   rÏ   rÐ   rÑ   rÒ   ré   rÓ   rÔ   rÕ   r‰   rÖ   r×   rØ   rÙ   rÚ   rÛ   rÜ   rÝ   rÞ   rß   rà   rá   Úps                           rU   rf   ÚAbstractConnection.__init__à   sô  € ö@ žÐ&9Ñ&EÜð+óð ð Ñ#Ü%4Ó%6ˆDÕ"à%5ˆDÔ"Ü—9’9“;ˆŒØŒØ&ÔØ ŒØ&ÔØ#6ˆÔ Ø ŒØ ˆŒØ,ÔØ!Ñ)Ø%3Ð"Ø&<Ô#Ø 0ÔØœXÒ%ØˆNÞà×!Ñ!¤,Ô/Ø,ÔÞ–NØ‰}Ü"¤9£;°Ó2�•
ô "Ÿ]š]¨5Ó1�”
à�J‰J×.Ñ.¨~Õ>äœy›{¨AÓ.ˆDŒJØ%:Ô"Ø!"ˆÔØ"4ˆÔÜ˜xÐ:JÓKˆŒØ"&ˆÔØˆŒ
Ø!1ÔØ�‰˜Ô%Ø"$ˆÔØ"ˆÔØ8<ˆÔð
	Ü�H“ˆAð �1‹u˜˜A›Ü%Ð&FÓGÐGàˆDŒMØ#×=Ñ=¸nÓMˆÕøô ó 	%Ü$ŠAÜó 	AÜ!Ð"?Ó@Ð@ð	Aûð �1‹u˜˜A›Ü%Ð&FÓGÐGàˆD�Mús$   ÆG ÇHÇ,H Ç.HÈH È H&c           	      óæ   • SR                  U R                  5        VVs/ sH  u  pU SU 3PM     snn5      nSU R                  R                   SU R                  R                   SU S3$ s  snnf )NÚ,Ú=Ú<Ú.Ú(ú)>)rj   r|   Ú	__class__rZ   rY   )rP   ÚkÚvÚ	repr_argss       rU   Ú__repr__ÚAbstractConnection.__repr__@  sn   € Ø—H‘H°T×5EÑ5EÔ5GÔHÑ5G©T¨Q   1 Q C›jÑ5GÒHÓIˆ	Ø�4—>‘>×,Ñ,Ð-¨Q¨t¯~©~×/FÑ/FÐ.GÀqÈÈÐSUÐVÐVùó Is   ŸA-
c                 ó   • g rb   rX   r{   s    rU   r|   ÚAbstractConnection.repr_piecesD  r~   r9   c                 óF   •  U R                  5         g ! [         a     g f = frb   )r—   Ú	Exceptionr{   s    rU   Ú__del__ÚAbstractConnection.__del__H  s#   € ð	Ø�O‰OÕøÜó 	Ùð	ús   ‚ “
 Ÿ c                 óŠ   • Ub  U$ [         (       a
  [        5       $ [        U R                  U R                  R
                  5      $ rb   )r/   r=   r_   rd   rî   rG   )rP   Úpackers     rU   rö   Ú,AbstractConnection._construct_command_packerN  s9   € ØÑØˆMßÒÜ(Ó*Ð*ä'¨×(;Ñ(;¸T¿\¹\×=PÑ=PÓQÐQr9   c                 ó†   • [         R                  " U5      nX R                  ;  a  U R                  R                  U5        gg)a.  
Register a callback to be called when the connection is established either
initially or reconnected.  This allows listeners to issue commands that
are ephemeral to the connection, for example pub/sub subscription or
key tracking.  The callback must be a _method_ and will be kept as
a weak reference.
N)ÚweakrefÚ
WeakMethodrñ   rI   )rP   r�   Úwms      rU   r‚   Ú,AbstractConnection.register_connect_callbackV  s9   € ô ×Ò Ó)ˆØ×,Ñ,Ó,Ø×#Ñ#×*Ñ*¨2Õ.ð -r9   c                 ó„   •  U R                   R                  [        R                  " U5      5        g! [         a     gf = f)z×
De-register a previously registered callback.  It will no-longer receive
notifications on connection events.  Calling this is not required when the
listener goes away, since the callbacks are kept as weak methods.
N)rñ   Úremover  r  rõ   r€   s     rU   r…   Ú.AbstractConnection.deregister_connect_callbackb  s8   € ð	Ø×#Ñ#×*Ñ*¬7×+=Ò+=¸hÓ+GÕHøÜó 	Ùð	ús   ‚/2 ²
?¾?c                 ó.   • U" U R                   S9U l        g)z«
Creates a new instance of parser_class with socket size:
_socket_read_size and assigns it to the parser for the connection
:param parser_class: The required parser class
)rÖ   N)rð   Ú_parserrˆ   s     rU   rŠ   ÚAbstractConnection.set_parserm  s   € ñ $°T×5KÑ5KÑLˆ�r9   c                 ór  ^ • T R                   (       a  g T R                  R                  U 4S jU 4S j5      nUT l          T R                  c  T R                  5         OT R                  T 5         T R                   Vs/ sH  o3" 5       (       d  M  UPM     snT l        T R                   H  nU" 5       nU(       d  M  U" T 5        M     g! [        R                   a    [        S5      e[         a  n[        T R                  U5      5      eSnAff = f! [         a    T R                  5         e f = fs  snf )z5Connects to the Redis server if not already connectedNc                  ó$   >• T R                  5       $ rb   )Ú_connectr{   s   €rU   Ú<lambda>Ú,AbstractConnection.connect.<locals>.<lambda>{  s   ø€ ˜Ÿ™œr9   c                 ó&   >• TR                  U 5      $ rb   ©r—   ©ÚerrorrP   s    €rU   r  r  {  s   ø€ °t·±ÀuÔ7Mr9   zTimeout connecting to server)rï   rÜ   Úcall_with_retryÚsocketr¨   r,   ÚOSErrorr(   Ú_error_messagerÝ   r“   r*   r—   rñ   )rP   ÚsockÚeÚrefr�   s   `    rU   r�   ÚAbstractConnection.connectu  s
  ø€ à�:�:Øð	:Ø—:‘:×-Ñ-Ü'Ô)MóˆDð ˆŒ
ð
	Ø×&Ñ&Ñ.à—‘Õ!ð ×'Ñ'¨Õ-ð 37×2IÒ2IÓ"SÑ2I¨3ÈSÏU§3Ñ2IÑ"SˆÔØ×*Ô*ˆCÙ“uˆHßˆxÙ˜–ò +øô- �~‰~ó 	?ÜÐ=Ó>Ð>Üó 	:Ü! $×"5Ñ"5°aÓ"8Ó9Ð9ûð	:ûô ó 	à�O‰OÔØð	üò #Ts5   •$C ÁD ÁD Á?D4ÂD4Ã(DÃ3DÄDÄD1c                 ó   • g rb   rX   r{   s    rU   r  ÚAbstractConnection._connect˜  r~   r9   c                 ó   • g rb   rX   r{   s    rU   Ú_host_errorÚAbstractConnection._host_errorœ  r~   r9   c                 ó6   • [        U R                  5       U5      $ rb   )r4   r/  )rP   Ú	exceptions     rU   r'  Ú!AbstractConnection._error_message   s   € Ü# D×$4Ñ$4Ó$6¸	ÓBÐBr9   c                 ó‚  • U R                   R                  U 5        U R                   nSnU R                  (       d"  U R                  (       d  U R                  (       aC  U R                  =(       d     [        U R                  U R                  5      nUR                  5       nU(       aÆ  U R                  S;  a¶  [        U R                   [        5      (       aK  U R                  [        5        UR                  U R                   l        U R                   R                  U 5        [        U5      S:X  a  SUS   /nU R                  " SU R                  S/UQ76   U R                  5       U l        GORU(       aC  U R                  " S/UQ7SS	06   U R                  5       n[%        U5      S:w  a  ['        S5      eGOU R                  S;  aø  [        U R                   [        5      (       aK  U R                  [        5        UR                  U R                   l        U R                   R                  U 5        U R                  SU R                  5        U R                  5       U l        U R                   R)                  S5      U R                  :w  a4  U R                   R)                  S5      U R                  :w  a  [+        S5      eU R,                  (       aE  U R                  SSU R,                  5        [%        U R                  5       5      S:w  a  [+        S5      e U R.                  (       a.  U R                  SSSU R.                  5        U R                  5          U R2                  (       a.  U R                  SSSU R2                  5        U R                  5         U R4                  (       aE  U R                  SU R4                  5        [%        U R                  5       5      S:w  a  [+        S5      egg! ["         a(    U R                  SUS
   S	S9  U R                  5       n GN‚f = f! [0         a     NØf = f! [0         a     N¨f = f)z=Initialize the connection, authenticate and select a databaseN)r:   Ú2r   Údefaultr   ÚHELLOÚAUTHrš   Féÿÿÿÿ©rš   ÚOKzInvalid Username or Passwords   protoÚprotozInvalid RESP versionÚCLIENTÚSETNAMEzError setting client nameÚSETINFOzLIB-NAMEzLIB-VERÚSELECTzInvalid Database)r  r“   rÞ   rÛ   rÏ   r"   Úget_credentialsrß   rD   r   rŠ   r   ÚEXCEPTION_CLASSESrl   r¤   r°   rº   r&   r6   r%   Úgetr(   rØ   rÙ   r+   rÚ   rÎ   )rP   ÚparserÚ	auth_argsÚcred_providerÚauth_responses        rU   r“   ÚAbstractConnection.on_connect£  sd  € à�‰×Ñ Ô%Ø—‘ˆàˆ	à×#×#¨¯¯¸¿¿à×(Ñ(÷ TÜ5°d·m±mÀTÇ]Á]ÓSð ð &×5Ñ5Ó7ˆIö ˜Ÿ™¨hÓ6Ü˜$Ÿ,™,¬×5Ñ5Ø—‘¤Ô-à17×1IÑ1I�—‘Ô.Ø—‘×'Ñ'¨Ô-Ü�9‹~ Ó"Ø&¨	°!©Ð5�	Ø×Ò˜g t§}¡}°fÐI¸yÓIØ&*×&8Ñ&8Ó&:ˆDÖ#ö
 ð ×Ò˜fÐE yÒE¸uÒEð5Ø $× 2Ñ 2Ó 4�ô ˜MÓ*¨dÓ2Ü)Ð*HÓIÐIñ 3ð �]‰] (Ó*Ü˜$Ÿ,™,¬×5Ñ5Ø—‘¤Ô-à17×1IÑ1I�—‘Ô.Ø—‘×'Ñ'¨Ô-Ø×Ñ˜g t§}¡}Ô5Ø&*×&8Ñ&8Ó&:ˆDÔ#à×'Ñ'×+Ñ+¨HÓ5¸¿¹ÓFØ×+Ñ+×/Ñ/°Ó8¸D¿M¹MÓIä%Ð&<Ó=Ð=ð ××Ø×Ñ˜h¨	°4×3CÑ3CÔDÜ˜D×.Ñ.Ó0Ó1°TÓ9Ü%Ð&AÓBÐBð	à�}�}Ø×!Ñ! (¨I°zÀ4Ç=Á=ÔQØ×"Ñ"Ô$ð	Ø××Ø×!Ñ! (¨I°yÀ$×BRÑBRÔSØ×"Ñ"Ô$ð
 �7�7Ø×Ñ˜h¨¯©Ô0Ü˜D×.Ñ.Ó0Ó1°TÓ9Ü%Ð&8Ó9Ð9ð :ð øôa 8ó 5ð
 ×!Ñ! &¨)°B©-ÀeÐ!ÑLØ $× 2Ñ 2Ó 4“ð5ûôJ ó 	Ùð	ûô ó 	Ùð	ús6   ÆO, Ì?P! Í?P1 Ï,.PÐPÐ!
P.Ð-P.Ð1
P>Ð=P>c                 óZ  • U R                   R                  5         U R                  nSU l        Uc  g[        R                  " 5       U R
                  :X  a    UR                  [        R                  5         UR                  5         g! [        [        4 a     N$f = f! [         a     gf = f)z!Disconnects from the Redis serverN)r  Úon_disconnectrï   rå   ræ   rç   Úshutdownr%  Ú	SHUT_RDWRr&  rL   Úclose)rP   r?   Ú	conn_socks      rU   r—   ÚAbstractConnection.disconnectý  s‘   € à�‰×"Ñ"Ô$à—J‘Jˆ	ØˆŒ
ØÑØä�9Š9‹;˜$Ÿ(™(Ó"ðØ×"Ñ"¤6×#3Ñ#3Ô4ð	Ø�O‰OÕøô	 œYÐ'ó Ùðûô
 ó 	Ùð	ús$   ÁB Á6B ÂBÂBÂ
B*Â)B*c                 ót   • U R                  SSS9  [        U R                  5       5      S:w  a  [        S5      eg)z Send PING, expect PONG in returnÚPINGFr:  ÚPONGz#Bad response from PING health checkN)r¤   r6   r°   r(   r{   s    rU   Ú
_send_pingÚAbstractConnection._send_ping  s<   € à×Ñ˜&¨uÐÑ5Ü˜×*Ñ*Ó,Ó-°Ó7Ü!Ð"GÓHÐHð 8r9   c                 ó$   • U R                  5         g)z Function to call when PING failsNr!  ©rP   r#  s     rU   Ú_ping_failedÚAbstractConnection._ping_failed  ó   € à�‰Õr9   c                 óº   • U R                   (       aJ  [        5       U R                  :”  a1  U R                  R	                  U R
                  U R                  5        ggg)z3Check the health of the connection with a PING/PONGN)r×   r   rí   rÜ   r$  rS  rW  r{   s    rU   rš   ÚAbstractConnection.check_health  sA   € à×%×%¬$«&°4×3IÑ3IÓ*IØ�J‰J×&Ñ& t§¡¸×8IÑ8IÕJð +JÐ%r9   Tc                 óv  • U R                   (       d  U R                  5         U(       a  U R                  5          [        U[        5      (       a  U/nU H  nU R                   R                  U5        M      g! [        R                   a    U R                  5         [        S5      e[         ao  nU R                  5         [        UR                  5      S:X  a  SUR                  S   peOUR                  S   nUR                  S   n[        SU SU S35      eSnAf[         a    U R                  5         e f = f)	z2Send an already packed command to the Redis serverzTimeout writing to socketr   ÚUNKNOWNr   zError z while writing to socket. rþ   N)rï   r�   rš   rD   rE   Úsendallr%  r¨   r—   r,   r&  rl   r?   r(   ÚBaseException)rP   rž   rš   Úitemr)  ÚerrnoÚerrmsgs          rU   rŸ   Ú&AbstractConnection.send_packed_command   sÿ   € à�z�zØ�L‰LŒNæØ×ÑÔð	Ü˜'¤3×'Ñ'Ø"˜)�Û�Ø—
‘
×"Ñ" 4Ö(ò  øä�~‰~ó 	<Ø�O‰OÔÜÐ:Ó;Ð;Üó 	WØ�O‰OÔÜ�1—6‘6‹{˜aÓØ )¨1¯6©6°!©9‘vàŸ™˜q™	�ØŸ™ ™�Ü! F¨5¨'Ð1KÈFÈ8ÐSTÐ"UÓVÐVûÜó 	ð
 �O‰OÔØð	ús   º<A7 Á78D8Â/A*DÄD8c                 ór   • U R                  U R                  R                  " U6 UR                  SS5      S9  g)z+Pack and send a command to the Redis serverrš   Tr:  N)rŸ   r÷   rV   rC  r¢   s      rU   r¤   ÚAbstractConnection.send_command?  s7   € à× Ñ Ø× Ñ ×%Ò% tÐ,ØŸ™ N°DÓ9ð 	!ò 	
r9   c                 ó  • U R                   nU(       d  U R                  5         U R                  5       n U R                  R	                  U5      $ ! [
         a0  nU R                  5         [        SU SUR                   35      eSnAff = f)z8Poll the socket to see if there's data that can be read.úError while reading from z: N)	rï   r�   r/  r  r©   r&  r—   r(   r?   )rP   r¨   r(  Ú
host_errorr)  s        rU   r©   ÚAbstractConnection.can_readF  sy   € à�z‰zˆÞØ�L‰LŒNà×%Ñ%Ó'ˆ
ð	VØ—<‘<×(Ñ(¨Ó1Ð1øÜó 	VØ�O‰OÔÜ!Ð$=¸j¸\ÈÈAÏFÉFÈ8Ð"TÓUÐUûð	Vús   µA Á
B
Á+BÂB
r«   c                ó–  • U R                  5       n U R                  S;   a%  [        (       d  U R                  R	                  XS9nOU R                  R	                  US9n U R                  (       a  [        5       U R                  -   U l        [!        U["        5      (       a   UeU$ ! [
        R                   a&    U(       a  U R                  5         [        SU 35      e[         a7  nU(       a  U R                  5         [        SU SUR                   35      eSnAf[         a    U(       a  U R                  5         e f = f! Af = f)z0Read the response from a previously sent command)Ú3rã   )r¯   r­   )r¯   zTimeout reading from rg  z : N)r/  rß   r/   r  r°   r%  r¨   r—   r,   r&  r(   r?   r_  r×   r   rí   rD   r+   )rP   r¯   r¬   r­   rh  Úresponser)  s          rU   r°   Ú AbstractConnection.read_responseT  s,  € ð ×%Ñ%Ó'ˆ
ð	Ø�}‰} Ó(×1BÒ1BØŸ<™<×5Ñ5Ø%5ð 6ð ‘ð  Ÿ<™<×5Ñ5ÐGWÐ5ÐX‘ð& ×%×%Ü%)£V¨d×.HÑ.HÑ%HˆDÔ"ä�h¤×.Ñ.ðØ�ð ˆøô5 �~‰~ó 	EÞ"Ø—‘Ô!ÜÐ!6°z°lÐCÓDÐDÜó 	Þ"Ø—‘Ô!Ü!Ø+¨J¨<¸3¸q¿v¹v¸hÐGóð ûô ó 	ö #Ø—‘Ô!Øð	ûñ ús*   ’4B( ÁB( Â$E Â(AEÃ*2DÄ&EÅEc                 ó4   • U R                   R                  " U6 $ )rB   )r÷   rV   r–   s     rU   rK   ÚAbstractConnection.pack_command‚  s   € à×#Ñ#×(Ò(¨$Ð/Ð/r9   c                 ó  • / n/ nSnU R                   nU H¾  nU R                  R                  " U6  Hž  n[        U5      nXE:”  d  X…:”  d  [	        U[
        5      (       a/  U(       a$  UR                  [        R                  U5      5        Sn/ nX…:”  d  [	        U[
        5      (       a  UR                  U5        M‰  UR                  U5        XH-  nM      MÀ     U(       a$  UR                  [        R                  U5      5        U$ )z.Pack multiple commands into the Redis protocolr   )	rd   r÷   rV   rl   rD   ro   rI   ri   rj   )	rP   r¶   rQ   ÚpiecesÚbuffer_lengthre   ÚcmdÚchunkÚchunklens	            rU   r·   Ú AbstractConnection.pack_commands†  sÖ   € àˆØˆØˆØ×+Ñ+ˆãˆCØ×-Ñ-×2Ò2°CÓ8�Ü˜u›:�à!Ó1ØÓ/Ü! %¬×4Ñ4æØŸ™¤i§n¡n°VÓ&<Ô=Ø$%�MØ�FàÓ+¬z¸%Ä×/LÑ/LØ—M‘M %Ö(à—M‘M %Ô(Ø!Ñ-’Mó! 9ñ ö& Ø�M‰Mœ)Ÿ.™.¨Ó0Ô1Øˆr9   rv   c                 ó   • U R                   $ rb   )rß   r{   s    rU   r�   ÚAbstractConnection.get_protocol¤  s   € Ø�}‰}Ðr9   c                 ó   • U R                   $ rb   ©Ú_handshake_metadatar{   s    rU   rº   Ú%AbstractConnection.handshake_metadata§  s   € à×'Ñ'Ð'r9   rS   c                 ó   • Xl         g rb   rz  )rP   rS   s     rU   rº   r|  «  s   € à#(Õ r9   r¼   c                 ó   • Xl         g rb   )rò   r¾   s     rU   r¿   Ú$AbstractConnection.set_re_auth_token¯  s   € Ø#Õr9   c                 óÖ   • U R                   b\  U R                  SU R                   R                  S5      U R                   R                  5       5        U R	                  5         S U l         g g ©Nr8  Úoid)rò   r¤   Útry_getÚ	get_valuer°   r{   s    rU   rÂ   ÚAbstractConnection.re_auth²  s`   € Ø×ÑÑ*Ø×ÑØØ×#Ñ#×+Ñ+¨EÓ2Ø×#Ñ#×-Ñ-Ó/ôð
 ×ÑÔ Ø"&ˆDÕð +r9   )rd   r÷   rñ   rä   r{  r  rò   rï   rð   rØ   rÞ   rÎ   rî   rº   r×   rÙ   rÚ   rí   rÏ   rç   rß   rÝ   rÜ   ré   rÒ   rÑ   rÐ   rÛ   rÄ   rÅ   rÆ   )4rY   rZ   r[   r\   Ú__doc__rè   r;   r5   ró   r   rE   ÚfloatÚboolr   r	   r
   r!   r$   rf   r  r   r|   r  rö   r‚   r…   rŠ   r�   r  r/  r'  r“   r—   rS  rW  rš   rŸ   r¤   r©   r°   rK   r·   r�   rÇ   r   rÈ   rº   Úsetterr   r¿   rÂ   r]   rX   r9   rU   rÊ   rÊ   Ý   sÝ  † Ù6ð Ø"&Ø*.Ø26Ø!&ØØØ'Ø!&Ø"Ø %Ø%&Ø%)Ø",Ù%4Ó%6Ø"&Ø"&Ø;?Ø<@Ø"#Ø7;Ø6:ñ/^Nàð^Nð ˜3‘-ð^Nð ! ™ð	^Nð
 !)¨¡ð^Nð ð^Nð ð^Nð ð^Nð ð^Nð ð^Nð  #ð^Nð ˜c‘]ð^Nð ˜3‘-ð^Nð  ˜c‘]ð!^Nð" ˜3‘-ð#^Nð$ �S˜$�YÑð%^Nð& % X¨b°$¨hÑ%7Ñ8ð'^Nð( &Ð&8Ñ9ð)^Nð* ˜3‘-ð+^Nð, ! ¨"¨d¨(Ñ!3Ñ4ð-^Nð. # ?Ñ3õ/^Nò@Wð ñó ðòòRò
/ò	òMò!ðF ñó ðð ñó ðòCòX:òtò(IòòKô
ò>
ôVð  ð,ð !Øö,ò\0òð<˜cŸj Sô ð ð( E¨$¨u°e¨|Ñ*<¸dÀ3ÈÀ8¹nÐ*LÑ$Mó (ó ð(ð ×Ñð)¨¨d°5¸%°<Ñ.@À$ÀsÈCÀxÁ.Ð.PÑ(Qó )ó ð)ð$ ~ô $õ'r9   rÊ   c                   óL   ^ • \ rS rSrSr     SU 4S jjrS rS rS rSr	U =r
$ )	Ú
Connectioni½  z4Manages TCP communication to and from a Redis serverc                 óŠ   >• Xl         [        U5      U l        X0l        U=(       d    0 U l        XPl        [        TU ]  " S0 UD6  g ©NrX   )Úhostró   ÚportÚsocket_keepaliveÚsocket_keepalive_optionsÚsocket_typeÚsuperrf   )rP   rŽ  r�  r�  r‘  r’  r£   r  s          €rU   rf   ÚConnection.__init__À  s>   ø€ ð Œ	Ü˜“IˆŒ	Ø 0ÔØ(@×(FÀBˆÔ%Ø&ÔÜ‰ÒÑ"˜6Ó"r9   c                 ó´   • SU R                   4SU R                  4SU R                  4/nU R                  (       a  UR	                  SU R                  45        U$ )NrŽ  r�  rÎ   rØ   )rŽ  r�  rÎ   rØ   rI   ©rP   rq  s     rU   r|   ÚConnection.repr_piecesÐ  sM   € Ø˜4Ÿ9™9Ð%¨°·	±	Ð':¸TÀ4Ç7Á7¸OÐLˆØ××Ø�M‰M˜=¨$×*:Ñ*:Ð;Ô<Øˆr9   c                 ó`  • Sn[         R                  " U R                  U R                  U R                  [         R
                  5       GH  nUu  p4pVnSn [         R                   " X4U5      nUR                  [         R                  [         R                  S5        U R                  (       ar  UR                  [         R                  [         R                  S5        U R                  R                  5        H%  u  pšUR                  [         R                  Xš5        M'     UR                  U R                  5        UR!                  U5        UR                  U R"                  5        Us  $    Ub  Ue[%        S5      e! [$         a(  nUnUb  UR'                  5          SnAGMY   SnAGM`  SnAff = f)zCreate a TCP socket connectionNr   z)socket.getaddrinfo returned an empty list)r%  ÚgetaddrinforŽ  r�  r’  ÚSOCK_STREAMÚ
setsockoptÚIPPROTO_TCPÚTCP_NODELAYr�  Ú
SOL_SOCKETÚSO_KEEPALIVEr‘  ÚitemsÚ
settimeoutrÑ   r�   rÐ   r&  rM  )rP   ÚerrÚresÚfamilyÚsocktyper<  Ú	canonnameÚsocket_addressr(  r  r  rR   s               rU   r  ÚConnection._connectÖ  sX  € ð
 ˆÜ×%Ò%Ø�I‰I�t—y‘y $×"2Ñ"2´F×4FÑ4F÷
ˆCð BEÑ>ˆF˜e°ØˆDð!Ü—}’} V°uÓ=�à—‘¤× 2Ñ 2´F×4FÑ4FÈÔJð ×(×(Ø—O‘O¤F×$5Ñ$5´v×7JÑ7JÈAÔNØ $× =Ñ =× CÑ CÖ E™˜ØŸ™¬×(:Ñ(:¸AÖAñ !Fð —‘ × ;Ñ ;Ô<ð —‘˜^Ô,ð —‘ × 3Ñ 3Ô4Ø’ñ1
ð> ‰?ØˆIÜÐAÓBÐBøô ó !Ø�ØÑ#Ø—J‘J—L“Lö $ûð!ús   ÁDE;Å;
F-ÆF(Æ(F-c                 ó8   • U R                    SU R                   3$ )NÚ:)rŽ  r�  r{   s    rU   r/  ÚConnection._host_errorÿ  s   € Ø—)‘)�˜A˜dŸi™i˜[Ð)Ð)r9   )rŽ  r�  r�  r‘  r’  )Ú	localhostië  FNr   ©rY   rZ   r[   r\   r†  rf   r|   r  r/  r]   Ú__classcell__©r  s   @rU   r‹  r‹  ½  s2   ø† Ù:ð ØØØ!%Ø÷#ò ò'C÷R*ð *r9   r‹  c                   óT  • \ rS rSrSrSrSrS\S\S\	R                  4S jrS	 rS
 rS rS rS rS rS rS rS(S jrS rS)S jr S*SSS.S jjrS rS r\S\\\\4   \\\4   4   4S j5       rS r S r!S\SS4S jr"S  r#S!\$\\\%\$\      4      4S" jr&S# r'S$\(4S% jr)S& r*S'r+g)+ÚCacheProxyConnectioni  s   fooz7.4.0ÚredisÚconnÚcacheÚ	pool_lockc                 ó¦  • [         R                  " 5       U l        Xl        U R                  R                  U l        U R                  R
                  U l        U R                  R                  U l        UR                  U l        X0l        X l	        [        R                  " 5       U l        S U l        S U l        U R                  U R                   5        g rb   )rå   ræ   rç   Ú_connrÜ   rŽ  r�  rÞ   Ú
_pool_lockÚ_cacheÚ	threadingÚLockÚ_cache_lockÚ_current_command_cache_keyÚ_current_optionsr‚   Ú_enable_tracking_callback)rP   r³  r´  rµ  s       rU   rf   ÚCacheProxyConnection.__init__  s�   € ô —9’9“;ˆŒØŒ
Ø—Z‘Z×%Ñ%ˆŒ
Ø—J‘J—O‘OˆŒ	Ø—J‘J—O‘OˆŒ	Ø#'×#;Ñ#;ˆÔ Ø#ŒØŒÜ$Ÿ>š>Ó+ˆÔØ*.ˆÔ'Ø $ˆÔØ×&Ñ& t×'EÑ'EÕFr9   c                 ó6   • U R                   R                  5       $ rb   )r·  r|   r{   s    rU   r|   Ú CacheProxyConnection.repr_pieces  s   € Ø�z‰z×%Ñ%Ó'Ð'r9   c                 ó:   • U R                   R                  U5        g rb   )r·  r‚   r€   s     rU   r‚   Ú.CacheProxyConnection.register_connect_callback  s   € Ø�
‰
×,Ñ,¨XÕ6r9   c                 ó:   • U R                   R                  U5        g rb   )r·  r…   r€   s     rU   r…   Ú0CacheProxyConnection.deregister_connect_callback!  s   € Ø�
‰
×.Ñ.¨xÕ8r9   c                 ó:   • U R                   R                  U5        g rb   )r·  rŠ   rˆ   s     rU   rŠ   ÚCacheProxyConnection.set_parser$  s   € Ø�
‰
×Ñ˜lÕ+r9   c                 ó(  • U R                   R                  5         U R                   R                  R                  SS 5      nUc&  U R                   R                  R                  SS 5      nU R                   R                  R                  SS 5      nUc&  U R                   R                  R                  SS 5      nUb  Uc  [	        S5      e[        U5      n[        U5      nXR                  :w  d  [        X R                  5      S:X  a  [	        S5      eg )Ns   serverÚservers   versionÚversionz0Cannot retrieve information about server versionr   ziTo maximize compatibility with all Redis products, client-side caching is supported by Redis 7.4 or later)	r·  r�   rº   rC  r(   r3   ÚDEFAULT_SERVER_NAMEr1   ÚMIN_ALLOWED_VERSION)rP   Úserver_nameÚ
server_vers      rU   r�   ÚCacheProxyConnection.connect'  sð   € Ø�
‰
×ÑÔà—j‘j×3Ñ3×7Ñ7¸	À4ÓHˆØÑØŸ*™*×7Ñ7×;Ñ;¸HÀdÓKˆKØ—Z‘Z×2Ñ2×6Ñ6°zÀ4ÓHˆ
ØÑØŸ™×6Ñ6×:Ñ:¸9ÀdÓKˆJØÑ Ñ!3Ü!Ð"TÓUÐUä" :Ó.ˆ
Ü# KÓ0ˆð ×3Ñ3Ó3Ü 
×,DÑ,DÓEÈÓJä!Ø{óð ð Kr9   c                 ó8   • U R                   R                  5         g rb   )r·  r“   r{   s    rU   r“   ÚCacheProxyConnection.on_connect>  s   € Ø�
‰
×ÑÕr9   c                 ó¶   • U R                      U R                  R                  5         S S S 5        U R                  R                  " U6   g ! , (       d  f       N(= frb   )r¼  r¹  Úflushr·  r—   r–   s     rU   r—   ÚCacheProxyConnection.disconnectA  s;   € Ø×ÓØ�K‰K×ÑÔ÷ à�
‰
×Ò˜tÒ$÷ Õús   �A
Á

Ac                 ó8   • U R                   R                  5         g rb   )r·  rš   r{   s    rU   rš   Ú!CacheProxyConnection.check_healthF  s   € Ø�
‰
×ÑÕ!r9   Tc                 ó:   • U R                   R                  U5        g rb   )r·  rŸ   r�   s      rU   rŸ   Ú(CacheProxyConnection.send_packed_commandI  s   € ð 	�
‰
×&Ñ& wÕ/r9   c           
      ó¼  • U R                  5         U R                     U R                  R                  [	        US   SS95      (       d-  S U l        U R                  R                  " U0 UD6   S S S 5        g  S S S 5        UR                  S5      c  [        S5      e[	        US   [        UR                  S5      5      S9U l        U R                     U R                  R                  U R
                  5      (       a·  U R                  R                  U R
                  5      nUR                  U R                  :w  an  U R                     UR                  R                  5       (       a:  UR                  R                  SS9  UR                  R                  5       (       a  M:  S S S 5         S S S 5        g U R                  R                  [!        U R
                  U R"                  [$        R&                  U R                  S95        S S S 5        U R                  R                  " U0 UD6  g ! , (       d  f       GNº= f! , (       d  f       N = f! , (       d  f       NN= f)	Nr   rX   )rž   Ú
redis_keysÚkeyszCannot create cache key.T©r­   )Ú	cache_keyÚcache_valueÚstatusÚconnection_ref)Ú_process_pending_invalidationsr¼  r¹  Úis_cachabler   r½  r·  r¤   rC  rõ   rF   rá  r¸  r©   r°   Úsetr   ÚDUMMY_CACHE_VALUEr   ÚIN_PROGRESS)rP   r?   r£   Úentrys       rU   r¤   Ú!CacheProxyConnection.send_commandN  sÓ  € Ø×+Ñ+Ô-à×Óð —;‘;×*Ñ*¬8¸DÀ¹GÐPRÑ+S×TÑTØ26�Ô/Ø—
‘
×'Ò'¨Ð8°Ò8Ø÷ Ðð U÷ ð �:‰:�fÓÑ%ÜÐ7Ó8Ð8ô +3Ø˜‘G¬¨f¯j©j¸Ó.@Ó(Añ+
ˆÔ'ð ×Óð �{‰{�‰˜t×>Ñ>×?Ñ?ØŸ™Ÿ™¨×(GÑ(GÓH�à×'Ñ'¨4¯:©:Ó5ØŸ›Ø#×2Ñ2×;Ñ;×=Ñ=Ø!×0Ñ0×>Ñ>ÈDÐ>ÑQð $×2Ñ2×;Ñ;×=Ó=÷ )ð ÷ Ðð  �K‰K�O‰OÜØ"×=Ñ=Ø $× 6Ñ 6Ü+×7Ñ7Ø#'§:¡:ñ	ô÷! ð6 	�
‰
×Ò Ð0¨Ó0÷W Öú÷0 )�ú÷ Õús9   �AH*ÃA6IÅAH<Æ"	IÆ4AIÈ*
H9È<
I
	ÉIÉ
Ic                 ó8   • U R                   R                  U5      $ rb   )r·  r©   r§   s     rU   r©   ÚCacheProxyConnection.can_read~  s   € Ø�z‰z×"Ñ" 7Ó+Ð+r9   Fr«   c                óÊ  • U R                      U R                  b¼  U R                  R                  U R                  5      b–  U R                  R                  U R                  5      R                  [
        R                  :w  aU  [        R                  " U R                  R                  U R                  5      R                  5      nS U l        UsS S S 5        $ S S S 5        U R                  R                  UUUS9nU R                      U R                  c  UsS S S 5        $ Uc1  U R                  R                  U R                  /5        UsS S S 5        $ U R                  R                  U R                  5      nUb6  [
        R                  Ul        XVl	        U R                  R                  U5        S U l        S S S 5        U$ ! , (       d  f       Nñ= f! , (       d  f       U$ = f)N)r¯   r¬   r­   )r¼  r½  r¹  rC  rà  r   ræ  rê   rë   rß  r·  r°   Údelete_by_cache_keysÚVALIDrä  )rP   r¯   r¬   r­   r£  rl  Úcache_entrys          rU   r°   Ú"CacheProxyConnection.read_response�  sŠ  € ð ×Óð ×/Ñ/Ñ;Ø—K‘K—O‘O D×$CÑ$CÓDÑPØ—K‘K—O‘O D×$CÑ$CÓD×KÑKÜ#×/Ñ/ó0ô —m’mØ—K‘K—O‘O D×$CÑ$CÓD×PÑPó�ð 37�Ô/Ø÷ ×Ñð —:‘:×+Ñ+Ø-Ø 3Ø%ð ,ð 
ˆð ×Óà×.Ñ.Ñ6Ø÷ Ñð
 ÑØ—‘×0Ñ0°$×2QÑ2QÐ1RÔSØ÷ Ñð Ÿ+™+Ÿ/™/¨$×*IÑ*IÓJˆKð Ñ&Ü%5×%;Ñ%;�Ô"Ø*2Ô'Ø—‘—‘ Ô,à.2ˆDÔ+÷% ð( ˆ÷Q Õú÷( Ôð( ˆús%   �C GÄGÄ*GÅA%GÇ
GÇ
G"c                 ó4   • U R                   R                  " U6 $ rb   )r·  rK   r–   s     rU   rK   Ú!CacheProxyConnection.pack_command®  s   € Ø�z‰z×&Ò&¨Ð-Ð-r9   c                 ó8   • U R                   R                  U5      $ rb   )r·  r·   rµ   s     rU   r·   Ú"CacheProxyConnection.pack_commands±  s   € Ø�z‰z×'Ñ'¨Ó1Ð1r9   rv   c                 ó.   • U R                   R                  $ rb   )r·  rº   r{   s    rU   rº   Ú'CacheProxyConnection.handshake_metadata´  s   € à�z‰z×,Ñ,Ð,r9   c                 ó8   • U R                   R                  5         g rb   )r·  r  r{   s    rU   r  ÚCacheProxyConnection._connect¸  s   € Ø�
‰
×ÑÕr9   c                 ó8   • U R                   R                  5         g rb   )r·  r/  r{   s    rU   r/  Ú CacheProxyConnection._host_error»  s   € Ø�
‰
×ÑÕ r9   Nc                 ó”   • UR                  SSS5        UR                  5         UR                  R                  U R                  5        g )Nr=  ÚTRACKINGÚON)r¤   r°   r  Úset_invalidation_push_handlerÚ_on_invalidation_callback)rP   r³  s     rU   r¿  Ú.CacheProxyConnection._enable_tracking_callback¾  s8   € Ø×Ñ˜( J°Ô5Ø×ÑÔØ�‰×2Ñ2°4×3QÑ3QÕRr9   c                 ó�   • U R                  5       (       a1  U R                  R                  SS9  U R                  5       (       a  M0  g g )NTrÝ  )r©   r·  r°   r{   s    rU   râ  Ú3CacheProxyConnection._process_pending_invalidationsÃ  s/   € Ø�m‰m�o‰oØ�J‰J×$Ñ$°$Ð$Ñ7ð �m‰m�o�or9   Údatac                 óÎ   • U R                      US   c  U R                  R                  5         OU R                  R                  US   5        S S S 5        g ! , (       d  f       g = f)Nr   )r¼  r¹  rÔ  Údelete_by_redis_keys)rP   r  s     rU   rþ  Ú.CacheProxyConnection._on_invalidation_callbackÇ  sF   € Ø×Óà�A‰w‰Ø—‘×!Ñ!Õ#à—‘×0Ñ0°°a±Ô9÷ ×Öús   �A AÁ
A$c                 ó6   • U R                   R                  5       $ rb   )r·  r�   r{   s    rU   r�   Ú!CacheProxyConnection.get_protocolÏ  s   € Ø�z‰z×&Ñ&Ó(Ð(r9   r¼   c                 ó:   • U R                   R                  U5        g rb   )r·  r¿   r¾   s     rU   r¿   Ú&CacheProxyConnection.set_re_auth_tokenÒ  s   € Ø�
‰
×$Ñ$ UÕ+r9   c                 ó8   • U R                   R                  5         g rb   )r·  rÂ   r{   s    rU   rÂ   ÚCacheProxyConnection.re_authÕ  s   € Ø�
‰
×ÑÕr9   )r¹  r¼  r·  r½  r¾  r¸  rÞ   rŽ  rç   r�  rÜ   rÄ   rÅ   rÆ   ),rY   rZ   r[   r\   rå  rÍ  rÌ  rx   r   rº  r»  rf   r|   r‚   r…   rŠ   r�   r“   r—   rš   rŸ   r¤   r©   r°   rK   r·   rÇ   r   r   rÈ   rE   rº   r  r/  r¿  râ  r   r   rþ  r�   r   r¿   rÂ   r]   rX   r9   rU   r±  r±    s+  † ØÐØ!ÐØ!ÐðGà!ðGð ðGð —>‘>ô	Gò&(ò7ò9ò,òò. ò%ò
"ô0ò
.1ô`,ð  %ð+Ø=AÐPUö+òZ.ò2ð ð- E¨$¨u°e¨|Ñ*<¸dÀ3ÈÀ8¹nÐ*LÑ$Mó -ó ð-òò!ðSÐ.Að SÀdô Sò
8ð:¨d°5¸¸hÀtÈEÁ{Ñ>SÐ9SÑ3TÑ.Uô :ò)ð, ~ô ,õr9   r±  c                   ó^   ^ • \ rS rSrSr              SU 4S jjrU 4S jrS rSrU =r	$ )ÚSSLConnectioniÙ  zÙManages SSL connections to and from the Redis server(s).
This class extends the Connection class, adding SSL functionality, and making
use of ssl.SSLContext (https://docs.python.org/3/library/ssl.html#ssl.SSLContext)
c                 óÞ  >• [         (       d  [        S5      eXl        X l        Uc  [        R
                  nO^[        U[        5      (       aI  [        R
                  [        R                  [        R                  S.nUU;  a  [        SU 35      eUU   nX0l
        X@l        XPl        Xpl        X`l        X€l        X�l        X l        X°l        XÀl        XÐl        Xàl        [,        TU ]\  " S0 UD6  g)aq  Constructor

Args:
    ssl_keyfile: Path to an ssl private key. Defaults to None.
    ssl_certfile: Path to an ssl certificate. Defaults to None.
    ssl_cert_reqs: The string value for the SSLContext.verify_mode (none, optional, required). Defaults to "required".
    ssl_ca_certs: The path to a file of concatenated CA certificates in PEM format. Defaults to None.
    ssl_ca_data: Either an ASCII string of one or more PEM-encoded certificates or a bytes-like object of DER-encoded certificates.
    ssl_check_hostname: If set, match the hostname during the SSL handshake. Defaults to False.
    ssl_ca_path: The path to a directory containing several CA certificates in PEM format. Defaults to None.
    ssl_password: Password for unlocking an encrypted private key. Defaults to None.

    ssl_validate_ocsp: If set, perform a full ocsp validation (i.e not a stapled verification)
    ssl_validate_ocsp_stapled: If set, perform a validation on a stapled ocsp response
    ssl_ocsp_context: A fully initialized OpenSSL.SSL.Context object to be used in verifying the ssl_ocsp_expected_cert
    ssl_ocsp_expected_cert: A PEM armoured string containing the expected certificate to be returned from the ocsp verification service.
    ssl_min_version: The lowest supported SSL version. It affects the supported SSL versions of the SSLContext. None leaves the default provided by ssl module.
    ssl_ciphers: A string listing the ciphers that are allowed to be used. Defaults to None, which means that the default ciphers are used. See https://docs.python.org/3/library/ssl.html#ssl.SSLContext.set_ciphers for more information.

Raises:
    RedisError
z$Python wasn't built with SSL supportN)ÚnoneÚoptionalÚrequiredz+Invalid SSL Certificate Requirements Flag: rX   )r0   r*   ÚkeyfileÚcertfileÚsslÚ	CERT_NONErD   rE   ÚCERT_OPTIONALÚCERT_REQUIREDÚ	cert_reqsÚca_certsÚca_dataÚca_pathÚcheck_hostnameÚcertificate_passwordÚssl_validate_ocspÚssl_validate_ocsp_stapledÚssl_ocsp_contextÚssl_ocsp_expected_certÚssl_min_versionÚssl_ciphersr“  rf   )rP   Ússl_keyfileÚssl_certfileÚssl_cert_reqsÚssl_ca_certsÚssl_ca_dataÚssl_check_hostnameÚssl_ca_pathÚssl_passwordr  r  r   r!  r"  r#  r£   Ú	CERT_REQSr  s                    €rU   rf   ÚSSLConnection.__init__ß  sÞ   ø€ ÷P Š}ÜÐCÓDÐDà"ŒØ$ŒØÑ ÜŸM™M‰MÜ˜¤s×+Ñ+äŸ™Ü×-Ñ-Ü×-Ñ-ñˆIð
  IÓ-Ü ØAÀ-ÀÐQóð ð & mÑ4ˆMØ&ŒØ$ŒØ"ŒØ"ŒØ0ÔØ$0Ô!Ø!2ÔØ)BÔ&Ø 0ÔØ&<Ô#Ø.ÔØ&ÔÜ‰ÒÑ"˜6Ó"r9   c                 óŽ   >• [         TU ]  5       n U R                  U5      $ ! [        [        4 a    UR                  5         e f = f)z>
Wrap the socket with SSL support, handling potential errors.
)r“  r  Ú_wrap_socket_with_sslr&  r*   rM  )rP   r(  r  s     €rU   r  ÚSSLConnection._connect'  sH   ø€ ô ‰wÑÓ!ˆð	Ø×-Ñ-¨dÓ3Ð3øÜœÐ$ó 	Ø�J‰JŒLØð	ús	   ‘" ¢"Ac                 óx  • [         R                  " 5       nU R                  Ul        U R                  Ul        U R
                  (       d  U R                  (       a/  UR                  U R
                  U R                  U R                  S9  U R                  c  U R                  c  U R                  b/  UR                  U R                  U R                  U R                  S9  U R                  b  U R                  Ul        U R                  (       a  UR!                  U R                  5        U R"                  SL a  [$        SL a  ['        S5      eU R(                  (       a  U R"                  (       a  ['        S5      eUR+                  XR,                  S9nU R(                  (       Ga,  S	SKnS
SKJn  U R4                  cf  UR6                  R9                  UR6                  R:                  5      nUR=                  U R
                  5        UR?                  U R                  5        OU R4                  nURA                  XPRB                  5        UR6                  RE                  U[F        RF                  " 5       5      nURI                  5         URK                  U R,                  U RL                  45        URO                  5         URQ                  5         U$ U R"                  SL a[  [$        (       aP  S
SKJ)n  U" X0R,                  U RL                  U R                  5      n	U	RU                  5       (       a  U$ [W        S5      eU$ )z}
Wraps the socket with SSL support.

Args:
    sock: The plain socket to wrap with SSL.

Returns:
    An SSL wrapped socket.
)r  r  rÏ   N)ÚcafileÚcapathÚcadataTFzcryptography is not installed.zKEither an OCSP staple or pure OCSP connection must be validated - not both.)Úserver_hostnamer   r   )Úocsp_staple_verifier)ÚOCSPVerifierzocsp validation error),r  Úcreate_default_contextr  r  Úverify_moder  r  Úload_cert_chainr  r  r  r  Úload_verify_locationsr"  Úminimum_versionr#  Úset_ciphersr  r.   r*   r  Úwrap_socketrŽ  ÚOpenSSLÚocspr6  r   ÚSSLÚContextÚSSLv23_METHODÚuse_certificate_fileÚuse_privatekey_fileÚset_ocsp_client_callbackr!  r‹  r%  Úrequest_ocspr�   r�  Údo_handshakerK  r7  Úis_validr(   )
rP   r(  ÚcontextÚsslsockr?  r6  Ú
staple_ctxÚconr7  Úos
             rU   r/  Ú#SSLConnection._wrap_socket_with_ssl2  sw  € ô ×,Ò,Ó.ˆØ!%×!4Ñ!4ˆÔØ"Ÿn™nˆÔØ�=�=˜DŸLŸLØ×#Ñ#ØŸ™ØŸ™Ø×2Ñ2ð $ñ ð �M‰MÑ%Ø�|‰|Ñ'Ø�|‰|Ñ'à×)Ñ)Ø—}‘}¨T¯\©\À$Ç,Á,ð *ñ ð ×ÑÑ+Ø&*×&:Ñ&:ˆGÔ#Ø××Ø×Ñ × 0Ñ 0Ô1Ø×!Ñ! TÒ)Ô.DÈÒ.MÜÐ=Ó>Ð>à×)×)¨d×.D×.DÜðóð ð
 ×%Ñ% d¿I¹IÐ%ÐFˆð ×)×)Ð)Ûå2ð ×$Ñ$Ñ,Ø$Ÿ[™[×0Ñ0°·±×1JÑ1JÓK�
Ø×/Ñ/°·±Ô>Ø×.Ñ.¨t¯|©|Õ<à!×2Ñ2�
à×/Ñ/Ø$×&AÑ&Aôð
 —+‘+×(Ñ(¨´V·]²]³_ÓEˆCØ×ÑÔØ�K‰K˜Ÿ™ D§I¡IÐ.Ô/Ø×ÑÔØ�L‰LŒNØˆNð ×!Ñ! TÒ)×.DÒ.DÝ*á˜W§i¡i°·±¸D¿M¹MÓJˆAØ�z‰z�|‰|Ø�ä%Ð&=Ó>Ð>Øˆr9   )r  r  r  r  r  r  r  r  r#  r"  r   r!  r  r  )NNr  NNFNNFFNNNN)
rY   rZ   r[   r\   r†  rf   r  r/  r]   r®  r¯  s   @rU   r  r  Ù  sL   ø† ñð ØØ ØØØ ØØØØ"'ØØ#ØØ÷F#õP	÷Mð Mr9   r  c                   óB   ^ • \ rS rSrSrSU 4S jjrS rS rS rSr	U =r
$ )	ÚUnixDomainSocketConnectioni‚  z4Manages UDS communication to and from a Redis serverc                 ó>   >• [         TU ]  " S0 UD6  Xl        X l        g r�  )r“  rf   ÚpathrÐ   )rP   rS  rÐ   r£   r  s       €rU   rf   Ú#UnixDomainSocketConnection.__init__…  s   ø€ Ü‰ÒÑ"˜6Ò"ØŒ	Ø,Õr9   c                 óš   • SU R                   4SU R                  4/nU R                  (       a  UR                  SU R                  45        U$ )NrS  rÎ   rØ   )rS  rÎ   rØ   rI   r–  s     rU   r|   Ú&UnixDomainSocketConnection.repr_piecesŠ  sB   € Ø˜4Ÿ9™9Ð%¨¨d¯g©g Ð7ˆØ××Ø�M‰M˜=¨$×*:Ñ*:Ð;Ô<Øˆr9   c                 óN  • [         R                   " [         R                  [         R                  5      nUR                  U R                  5         UR                  U R                  5        UR                  U R                  5        U$ ! [         a    UR                  5         e f = f)z&Create a Unix domain socket connection)
r%  ÚAF_UNIXrš  r¡  rÑ   r�   rS  r&  rM  rÐ   )rP   r(  s     rU   r  Ú#UnixDomainSocketConnection._connect�  sy   € ä�}Š}œVŸ^™^¬V×-?Ñ-?Ó@ˆØ�‰˜×3Ñ3Ô4ð	Ø�L‰L˜Ÿ™Ô#ð
 	�‰˜×+Ñ+Ô,Øˆøô ó 	à�J‰JŒLØð	ús   ÁB ÂB$c                 ó   • U R                   $ rb   )rS  r{   s    rU   r/  Ú&UnixDomainSocketConnection._host_error�  s   € Ø�y‰yÐr9   )rS  rÐ   )Ú Nr­  r¯  s   @rU   rQ  rQ  ‚  s   ø† Ù:÷-ò
ò÷ð r9   rQ  )Ú0ÚFÚFALSEÚNÚNOc                 óˆ   • U b  U S:X  a  g [        U [        5      (       a  U R                  5       [        ;   a  g[	        U 5      $ )Nr\  F)rD   rE   ÚupperÚFALSE_STRINGSrˆ  )rS   s    rU   Úto_boolre  ¤  s7   € Ø�}˜ ›ØÜ�%œ×Ñ %§+¡+£-´=Ó"@ØÜ�‹;Ðr9   )
rÎ   rÐ   rÑ   r�  rÒ   ré   Úmax_connectionsr×   r)  r¨   c                 óÂ  • U R                  S5      (       d7  U R                  S5      (       d!  U R                  S5      (       d  [        S5      e[        U 5      n 0 n[        U R                  5      R                  5        HZ  u  p#U(       d  M  [        U5      S:”  d  M  [        US   5      n[        R                  U5      nU(       a   U" U5      X'   MV  X1U'   M\     U R                  (       a  [        U R                  5      US'   U R                  (       a  [        U R                  5      US	'   U R                  S
:X  a4  U R                  (       a  [        U R                  5      US'   [        US'   U$ U R                   (       a  [        U R                   5      US'   U R"                  (       a  [%        U R"                  5      US'   U R                  (       a8  SU;  a2   [%        [        U R                  5      R'                  SS5      5      US'   U R                  S:X  a	  [*        US'   U$ ! [        [        4 a    [        SU S35      ef = f! [(        [        4 a     NPf = f)Nzredis://z	rediss://zunix://zRRedis URL must specify one of the following schemes (redis://, rediss://, unix://)r   zInvalid value for 'z' in connection URL.rÛ   rÏ   ÚunixrS  Úconnection_classrŽ  r�  rÎ   Ú/r\  Úrediss)Ú
startswithrõ   r   r   Úqueryr   rl   r   ÚURL_QUERY_ARGUMENT_PARSERSrC  rL   rÛ   rÏ   ÚschemerS  rQ  Úhostnamer�  ró   ÚreplaceÚAttributeErrorr  )Úurlr£   ÚnamerS   rD  s        rU   Ú	parse_urlru  º  sù  € à�‰�z×"Ñ"Ø�>‰>˜+×&Ñ&Ø�>‰>˜)×$Ñ$äð5ó
ð 	
ô
 �3‹-€CØ€Fä §	¡	Ó*×0Ñ0Ö2‰ˆßˆ5”S˜“Z !•^Ü˜E !™HÓ%ˆEÜ/×3Ñ3°DÓ9ˆFÞðWÙ#)¨%£=�F“Lð  %�t“ñ 3ð ‡|‡|Ü$ S§\¡\Ó2ˆˆzÑØ
‡|‡|Ü$ S§\¡\Ó2ˆˆzÑð ‡z�z�VÓØ�8�8Ü$ S§X¡XÓ.ˆF�6‰NÜ%?ˆÐ!Ñ"ð& €Mð! �<�<Ü$ S§\¡\Ó2ˆF�6‰NØ�8�8Ü  §¡›]ˆF�6‰Nð �8�8˜ FÓ*ðÜ"¤7¨3¯8©8Ó#4×#<Ñ#<¸SÀ"Ó#EÓF��t‘ð �:‰:˜Ó!Ü)6ˆFÐ%Ñ&à€MøôC "¤:Ð.ó WÜ$Ð':¸4¸&Ð@TÐ%UÓVÐVðWûô6 #¤JÐ/ó Ùðús   Ã
H(Ç1I È( IÉIÉIÚ_CPÚConnectionPool)Úboundc                   ó2  • \ rS rSrSr\S\\   S\S\4S j5       r	\
SS4S\\   S	\\   4S
 jjrS\\44S jrS rS#S jrS#S jr\" S/SSS9S$S%S jj5       rS\4S jrS&S jrS'S jrSSS\4S jrS(S\SS4S jjrS#S jrS)S jrS\4S jrS \ 4S! jr!S"r"g)*rw  iö  aˆ  
Create a connection pool. ``If max_connections`` is set, then this
object raises :py:class:`~redis.exceptions.ConnectionError` when the pool's
limit is reached.

By default, TCP connections are created unless ``connection_class``
is specified. Use class:`.UnixDomainSocketConnection` for
unix sockets.

Any additional keyword arguments are passed to the constructor of
``connection_class``.
Úclsrs  rv   c                 óf   • [        U5      nSU;   a  US   US'   UR                  U5        U " S0 UD6$ )a1  
Return a connection pool configured from the given URL.

For example::

    redis://[[username]:[password]]@localhost:6379/0
    rediss://[[username]:[password]]@localhost:6379/0
    unix://[username@]/path/to/socket.sock?db=0[&password=password]

Three URL schemes are supported:

- `redis://` creates a TCP socket connection. See more at:
  <https://www.iana.org/assignments/uri-schemes/prov/redis>
- `rediss://` creates a SSL wrapped TCP socket connection. See more at:
  <https://www.iana.org/assignments/uri-schemes/prov/rediss>
- ``unix://``: creates a Unix Domain Socket connection.

The username, password, hostname, path and all querystring values
are passed through urllib.parse.unquote in order to replace any
percent-encoded values with their corresponding characters.

There are several ways to specify a database number. The first value
found will be used:

    1. A ``db`` querystring option, e.g. redis://localhost?db=0
    2. If using the redis:// or rediss:// schemes, the path argument
       of the url, e.g. redis://localhost/0
    3. A ``db`` keyword argument to this function.

If none of these options are specified, the default db=0 is used.

All querystring options are cast to their appropriate Python types.
Boolean arguments can be specified with string values "True"/"False"
or "Yes"/"No". Values that cannot be properly cast cause a
``ValueError`` to be raised. Once parsed, the querystring arguments
and keyword arguments are passed to the ``ConnectionPool``'s
class initializer. In the case of conflicting arguments, querystring
arguments always win.
ri  rX   )ru  Úupdate)rz  rs  r£   Úurl_optionss       rU   Úfrom_urlÚConnectionPool.from_url  s?   € ôR   “nˆà Ó'Ø.4Ð5GÑ.HˆKÐ*Ñ+à�‰�kÔ"Ù‰}�V‰}Ðr9   Nrf  Úcache_factoryc                 óØ  • U=(       d    Sn[        U[        5      (       a  US:  a  [        S5      eXl        X@l        X l        S U l        X0l        UR                  S5      (       d  UR                  S5      (       aÉ  UR                  S5      S;  a  [        S5      eU R                  R                  S5      nUb'  [        U[        5      (       d  [        S	5      eXPl        OdU R                  b   U R                  R                  5       U l        O7[        U R                  R                  S5      5      R                  5       U l        UR                  SS 5        UR                  SS 5        U R                  R                  S
S 5      U l        U R                  c  [        5       U l        [         R"                  " 5       U l        [         R"                  " 5       U l        U R)                  5         g )Nl        r   z,"max_connections" must be a positive integerÚcache_configr´  rß   )rã   rk  z4Client caching is only supported with RESP version 3z#Cache must implement CacheInterfacerá   )rD   ró   rõ   ri  Úconnection_kwargsrf  r´  Ú_cache_factoryrC  r*   r   Ú	get_cacher   Úpoprä   r$   rº  r»  Ú
_fork_lockÚ_lockÚreset)rP   ri  rf  r€  rƒ  r´  s         rU   rf   ÚConnectionPool.__init__5  s‘  € ð *×2¨UˆÜ˜/¬3×/Ñ/°?ÀQÓ3FÜÐKÓLÐLà 0ÔØ!2ÔØ.ÔØˆŒ
Ø+Ôà× Ñ  ×0Ñ0Ð4E×4IÑ4IÈ'×4RÑ4RØ ×$Ñ$ ZÓ0¸Ó@Ü Ð!WÓXÐXà×*Ñ*×.Ñ.¨wÓ7ˆEàÑ Ü! %¬×8Ñ8Ü$Ð%JÓKÐKà"•
à×&Ñ&Ñ2Ø!%×!4Ñ!4×!>Ñ!>Ó!@�D•Jä!-Ø×.Ñ.×2Ñ2°>ÓBó"ç‘i“kð ”Jð 	×Ñ˜g tÔ,Ø×Ñ˜n¨dÔ3à!%×!7Ñ!7×!;Ñ!;Ð<NÐPTÓ!UˆÔØ×!Ñ!Ñ)Ü%4Ó%6ˆDÔ"ô $Ÿ.š.Ó*ˆŒÜ—^’^Ó%ˆŒ
Ø�
‰
�r9   c                 ó¬   • S[        U 5      R                   S[        U 5      R                   S[        U R                  " S0 U R
                  D65       S3$ )Nrý   rþ   rÿ   r   rX   )ÚtyperZ   rY   Úreprri  rƒ  r{   s    rU   r  ÚConnectionPool.__repr__l  sS   € à”�T“
×%Ñ%Ð& a¬¨T«
×(;Ñ(;Ð'<Ø”�T×*Ò*ÑD¨T×-CÑ-CÑDÓEÐFÀbðJð	
r9   c                 ó:   • U R                   R                  SS5      $ )zŠ
Returns:
    The RESP protocol version, or ``None`` if the protocol is not specified,
    in which case the server default will be used.
rß   N)rƒ  rC  r{   s    rU   r�   ÚConnectionPool.get_protocolr  s   € ð ×%Ñ%×)Ñ)¨*°dÓ;Ð;r9   c                 ór   • SU l         / U l        [        5       U l        [        R
                  " 5       U l        g )Nr   )Ú_created_connectionsÚ_available_connectionsrä  Ú_in_use_connectionsrå   ræ   rç   r{   s    rU   r‰  ÚConnectionPool.resetz  s+   € Ø$%ˆÔ!Ø&(ˆÔ#Ü#&£5ˆÔ ô —9’9“;ˆ�r9   c                 ór  • U R                   [        R                  " 5       :w  au  U R                  R	                  SS9nU(       d  [
        e U R                   [        R                  " 5       :w  a  U R                  5         U R                  R                  5         g g ! U R                  R                  5         f = f)Né   )r¨   )rç   rå   ræ   r‡  Úacquirer'   r‰  Úrelease)rP   Úacquireds     rU   Ú	_checkpidÚConnectionPool._checkpidŠ  s€   € ðF �8‰8”r—y’y“{Ó"Ø—‘×.Ñ.°qÐ.Ð9ˆHÞÜ*Ð*ð*Ø—8‘8œrŸyšy›{Ó*Ø—J‘J”Là—‘×'Ñ'Õ)ð #øð —‘×'Ñ'Õ)ús   Á3B ÂB6Ú*ú)Use get_connection() without args insteadú5.3.0©Úargs_to_warnÚreasonrË  r‹  c                 óŠ  • U R                  5         U R                      U R                  R                  5       nU R                  R                  U5        SSS5         WR                  5          UR                  5       (       a  U R                  c  [        S5      eU$ ! [         a    U R                  5       n N€f = f! , (       d  f       No= f! [        [        4 aD    UR                  5         UR                  5         UR                  5       (       a  [        S5      e U$ f = f! [         a    U R                  W5        e f = f)zGet a connection from the poolNúConnection has dataúConnection not ready)r›  rˆ  r“  r†  Ú
IndexErrorÚmake_connectionr”  Úaddr�   r©   r´  r(   r&  r—   r_  r™  ©rP   Úcommand_namerÜ  ÚoptionsÚ
connections        rU   Úget_connectionÚConnectionPool.get_connection¹  s+  € ð 	�‰ÔØ�Z‹Zð4Ø!×8Ñ8×<Ñ<Ó>�
ð ×$Ñ$×(Ñ(¨Ô4÷ ð	à×ÑÔ ð
BØ×&Ñ&×(Ñ(¨T¯Z©ZÑ-?Ü)Ð*?Ó@Ð@ð Ðøô3 ó 4Ø!×1Ñ1Ó3’
ð4ú÷ �Zûô" $¤WÐ-ó BØ×%Ñ%Ô'Ø×"Ñ"Ô$Ø×&Ñ&×(Ñ(Ü)Ð*@ÓAÐAð )ð ÐðBûô
 ó 	ð �L‰L˜Ô$Øð		úsX   �B=ŸB¹B=ÁD% Á.-C ÂB:Â7B=Â9B:Â:B=Â=
CÃAD"ÄD% Ä!D"Ä"D% Ä%Ec                 ó�   • U R                   n[        UR                  SS5      UR                  SS5      UR                  SS5      S9$ )z,Return an encoder based on encoding settingsrÓ   rÌ   rÔ   rÍ   rÕ   F)rÓ   rÔ   rÕ   )rƒ  r   rC  )rP   r£   s     rU   Úget_encoderÚConnectionPool.get_encoderà  sF   € à×'Ñ'ˆÜØ—Z‘Z 
¨GÓ4Ø"ŸJ™JÐ'8¸(ÓCØ#ŸZ™ZÐ(:¸EÓBñ
ð 	
r9   c                 ó>  • U R                   U R                  :¼  a  [        S5      eU =R                   S-  sl         U R                  b;  [	        U R
                  " S0 U R                  D6U R                  U R                  5      $ U R
                  " S0 U R                  D6$ )zCreate a new connectionzToo many connectionsr   rX   )r’  rf  r(   r´  r±  ri  rƒ  rˆ  r{   s    rU   r§  ÚConnectionPool.make_connectioné  s‰   € à×$Ñ$¨×(<Ñ(<Ó<Ü!Ð"8Ó9Ð9Ø×!Ò! QÑ&Õ!à�:‰:Ñ!Ü'Ø×%Ò%Ñ?¨×(>Ñ(>Ñ?ÀÇÁÈTÏZÉZóð ð ×$Ò$Ñ> t×'=Ñ'=Ñ>Ð>r9   r¬  c                 óº  • U R                  5         U R                      U R                  R                  U5        U R                  U5      (       a@  U R                  R                  U5        U R                  R                  [        U5      5        OUR                  5          SSS5        g SSS5        g! [         a     SSS5        gf = f! , (       d  f       g= f)z(Releases the connection back to the poolN)r›  rˆ  r”  r  ÚKeyErrorÚowns_connectionr“  rI   rä   Údispatchr#   r—   ©rP   r¬  s     rU   r™  ÚConnectionPool.releaseö  s¸   € à�‰ÔØ�Z‹ZðØ×(Ñ(×/Ñ/°
Ô;ð ×#Ñ# J×/Ñ/Ø×+Ñ+×2Ñ2°:Ô>Ø×&Ñ&×/Ñ/Ü0°Ó<õð ×%Ñ%Ô'Ø÷' ˆZð÷ ˆZøô ó ð ÷ ˆZðú÷ �Zús.   �CŸB4ºA'CÂ4
C	Â>CÃC	Ã	CÃ
Cc                 ó4   • UR                   U R                   :H  $ rb   )rç   r¸  s     rU   r¶  ÚConnectionPool.owns_connection  s   € Ø�~‰~ §¡Ñ)Ð)r9   Úinuse_connectionsc                 ó
  • U R                  5         U R                     U(       a!  [        U R                  U R                  5      nOU R                  nU H  nUR                  5         M     SSS5        g! , (       d  f       g= f)z×
Disconnects connections in the pool

If ``inuse_connections`` is True, disconnect connections that are
current in use, potentially by other threads. Otherwise only disconnect
connections that are idle in the pool.
N)r›  rˆ  r   r“  r”  r—   )rP   r¼  Úconnectionsr¬  s       rU   r—   ÚConnectionPool.disconnect  s`   € ð 	�‰ÔØ�Z‹ZÞ Ü#Ø×/Ñ/°×1IÑ1Ió‘ð #×9Ñ9�ã)�
Ø×%Ñ%Ö'ñ *÷ �ZŽZús   �AA4Á4
Bc                 ó$   • U R                  5         g)z-Close the pool, disconnecting all connectionsNr!  r{   s    rU   rM  ÚConnectionPool.close%  rY  r9   c                 ó¢   • U R                   R                  SU05        U R                   H	  nXl        M     U R                   H	  nXl        M     g )NrÜ   )rƒ  r|  r“  rÜ   r”  )rP   rÜ   r³  s      rU   Ú	set_retryÚConnectionPool.set_retry)  sE   € Ø×Ñ×%Ñ% w°Ð&6Ô7Ø×/Ô/ˆDØŽJñ 0à×,Ô,ˆDØŽJò -r9   r¼   c                 óV  ^ ^^• T R                      T R                   HL  mTR                  R                  UU4S jU 4S j5        TR                  R                  U4S jU 4S j5        MN     T R                   H  mTR                  T5        M     S S S 5        g ! , (       d  f       g = f)Nc                  ód   >• T R                  STR                  S5      TR                  5       5      $ r�  )r¤   rƒ  r„  )r³  r¼   s   €€rU   r  Ú1ConnectionPool.re_auth_callback.<locals>.<lambda>4  s'   ø€ ˜D×-Ñ-Ø §¡¨eÓ 4°e·o±oÓ6Gôr9   c                 ó&   >• TR                  U 5      $ rb   ©Ú_mockr"  s    €rU   r  rÇ  7  s   ø€  $§*¡*¨UÔ"3r9   c                  ó$   >• T R                  5       $ rb   )r°   )r³  s   €rU   r  rÇ  :  s   ø€ ˜D×.Ñ.Ô0r9   c                 ó&   >• TR                  U 5      $ rb   rÉ  r"  s    €rU   r  rÇ  :  s   ø€ ÀÇ
Á
È5Ô@Qr9   )rˆ  r“  rÜ   r$  r”  r¿   )rP   r¼   r³  s   ``@rU   Úre_auth_callbackÚConnectionPool.re_auth_callback0  sz   ú€ Ø�Z‹ZØ×3Ô3�Ø—
‘
×*Ñ*õô 4ô	ð —
‘
×*Ñ*Ü0Ô2Qöñ 4ð ×0Ô0�Ø×&Ñ& uÖ-ñ 1÷ �ZŽZús   �BBÂ
B(r#  c              ƒ   ó   #   • g7f)z_
Dummy functions, needs to be passed as error callback to retry object.
:param error:
:return:
NrX   rV  s     rU   rÊ  ÚConnectionPool._mock?  s
   é € ð 	ùs   ‚)r“  r„  r’  rä   r‡  r”  rˆ  r´  ri  rƒ  rf  rç   ru   rb   )rv   r‹  )rv   rx   )r¬  r‹  rv   NrÄ   )rÜ   r-   rv   N)#rY   rZ   r[   r\   r†  Úclassmethodr   rv  rE   r~  r‹  r   ró   r   rf   r  r�   r‰  r›  r2   r­  r   r°  r§  r™  r¶  rˆ  r—   rM  rÃ  r   rÍ  r*   rÊ  r]   rX   r9   rU   rw  rw  ö  s  † ñð ð.�d˜3‘ið . cð .¸ó .ó ð.ðd $Ø)-Ø9=ñ	5ð " #™ð5ð  Ð 5Ñ6õ	5ðn
˜3 ˜*ô 
ò<ôô -*ñ^ Ø�UØ:Øñõ
 óð
 ðD
˜Wô 
ô?ôð0*¨,ð *¸3ô *ñ(¨Dð (¸Dõ (ô(ôð. nô .ð ÷ r9   c                   ór   ^ • \ rS rSrSrSS\\4U 4S jjrS rS r	\
" S/S	S
S9SS j5       rS rS rSrU =r$ )ÚBlockingConnectionPooliH  a¼  
Thread-safe blocking connection pool::

    >>> from redis.client import Redis
    >>> client = Redis(connection_pool=BlockingConnectionPool())

It performs the same function as the default
:py:class:`~redis.ConnectionPool` implementation, in that,
it maintains a pool of reusable connections that can be shared by
multiple redis clients (safely across threads if required).

The difference is that, in the event that a client tries to get a
connection from the pool when all of connections are in use, rather than
raising a :py:class:`~redis.ConnectionError` (as the default
:py:class:`~redis.ConnectionPool` implementation does), it
makes the client wait ("blocks") for a specified number of seconds until
a connection becomes available.

Use ``max_connections`` to increase / decrease the pool size::

    >>> pool = BlockingConnectionPool(max_connections=10)

Use ``timeout`` to tell it either how many seconds to wait for a connection
to become available, or to block forever:

    >>> # Block forever.
    >>> pool = BlockingConnectionPool(timeout=None)

    >>> # Raise a ``ConnectionError`` after five seconds if a connection is
    >>> # not available.
    >>> pool = BlockingConnectionPool(timeout=5)
é2   é   c                 óD   >• X@l         X l        [        TU ]  " SUUS.UD6  g )N)ri  rf  rX   )Úqueue_classr¨   r“  rf   )rP   rf  r¨   ri  r×  rƒ  r  s         €rU   rf   ÚBlockingConnectionPool.__init__j  s2   ø€ ð 'ÔØŒÜ‰Òð 	
Ø-Ø+ñ	
ð  ó	
r9   c                 óä   • U R                  U R                  5      U l          U R                  R                  S 5        M  ! [         a     Of = f/ U l        [        R                  " 5       U l        g rb   )	r×  rf  ÚpoolÚ
put_nowaitr   Ú_connectionsrå   ræ   rç   r{   s    rU   r‰  ÚBlockingConnectionPool.resetz  sf   € à×$Ñ$ T×%9Ñ%9Ó:ˆŒ	ØðØ—	‘	×$Ñ$ TÔ*ñ øô ó Ùðúð
 ˆÔô —9’9“;ˆ�s   £A  Á 
AÁAc                 ó  • U R                   b<  [        U R                  " S0 U R                  D6U R                   U R                  5      nOU R                  " S0 U R                  D6nU R
                  R                  U5        U$ )zMake a fresh connection.rX   )r´  r±  ri  rƒ  rˆ  rÜ  rI   r¸  s     rU   r§  Ú&BlockingConnectionPool.make_connection’  sn   € à�:‰:Ñ!Ü-Ø×%Ò%Ñ?¨×(>Ñ(>Ñ?ÀÇÁÈTÏZÉZó‰Jð ×.Ò.ÑH°×1GÑ1GÑHˆJØ×Ñ× Ñ  Ô,ØÐr9   r�  rž  rŸ  r   c                 ó   • U R                  5         Sn U R                  R                  SU R                  S9nUc  U R                  5       n UR                  5          UR                  5       (       a  [        S5      e U$ ! [         a    [        S5      ef = f! [
        [        4 aD    UR                  5         UR                  5         UR                  5       (       a  [        S5      e U$ f = f! [         a    U R                  U5        e f = f)aï  
Get a connection, blocking for ``self.timeout`` until a connection
is available from the pool.

If the connection returned is ``None`` then creates a new connection.
Because we use a last-in first-out queue, the existing connections
(having been returned to the pool after the initial ``None`` values
were added) will be returned before ``None`` values. This means we only
create new connections when we need to, i.e.: the actual number of
connections will only increase in response to demand.
NT)Úblockr¨   zNo connection available.r¤  r¥  )r›  rÚ  rC  r¨   r   r(   r§  r�   r©   r&  r—   r_  r™  r©  s        rU   r­  Ú%BlockingConnectionPool.get_connection�  s  € ð$ 	�‰Ôð ˆ
ð	>ØŸ™Ÿ™¨T¸4¿<¹<˜ÐHˆJð ÑØ×-Ñ-Ó/ˆJð	à×ÑÔ ð
BØ×&Ñ&×(Ñ(Ü)Ð*?Ó@Ð@ð )ð Ðøô= ó 	>ô "Ð"<Ó=Ð=ð	>ûô( $¤WÐ-ó BØ×%Ñ%Ô'Ø×"Ñ"Ô$Ø×&Ñ&×(Ñ(Ü)Ð*@ÓAÐAð )ð ÐðBûô
 ó 	à�L‰L˜Ô$Øð	ús6   ”$B  ÁC0 Á B Â BÂAC-Ã)C0 Ã,C-Ã-C0 Ã0Dc                 ó   • U R                  5         U R                  U5      (       d,  UR                  5         U R                  R	                  S5        g U R                  R	                  U5        g! [
         a     gf = f)z)Releases the connection back to the pool.N)r›  r¶  r—   rÚ  rÛ  r   r¸  s     rU   r™  ÚBlockingConnectionPool.releaseÖ  sm   € ð 	�‰ÔØ×#Ñ# J×/Ñ/ð
 ×!Ñ!Ô#Ø�I‰I× Ñ  Ô&Øð	Ø�I‰I× Ñ  Õ,øÜó 	ñ ð	ús   ÁA0 Á0
A=Á<A=c                 ój   • U R                  5         U R                   H  nUR                  5         M     g)z(Disconnects all connections in the pool.N)r›  rÜ  r—   r¸  s     rU   r—   Ú!BlockingConnectionPool.disconnectë  s(   € à�‰ÔØ×+Ô+ˆJØ×!Ñ!Ö#ò ,r9   )rÜ  rç   rÚ  r×  r¨   rb   )rY   rZ   r[   r\   r†  r‹  r   rf   r‰  r§  r2   r­  r™  r—   r]   r®  r¯  s   @rU   rÓ  rÓ  H  sZ   ø† ñðF ØØ#Ø÷
ò ò0	ñ Ø�UØ:Øñó
2óð
2òh÷*$ð $r9   rÓ  )drê   rå   r%  r  rM   rº  r  Úabcr   Ú	itertoolsr   Úqueuer   r   r   r   Útypingr	   r
   r   r   r   r   r   r   Úurllib.parser   r   r   Úredis.cacher   r   r   r   r   r   Ú_parsersr   r   r   r   Ú
auth.tokenr   Úbackoffr    Úcredentialsr!   r"   Úeventr#   r$   Ú
exceptionsr%   r&   r'   r(   r)   r*   r+   r,   rÜ   r-   Úutilsr.   r/   r0   r1   r2   r3   r4   r5   r6   rJ   rk   rp   rm   ri   rô   Úobjectrè   Ú__annotations__r;   r=   r_   rx   rÊ   r‹  r±  r  rQ  rd  re  ró   r‡  Úlistrn  ru  rv  rw  rÓ  rX   r9   rU   Ú<module>r÷     s™  ðÜ Û 	Û Û 
Û 
Û Û Ý Ý ß (Ñ (Ý ß L× LÓ Lß 4Ñ 4÷÷ ÷ JÓ IÝ &Ý ß Oß @÷	÷ 	ó 	õ ÷
÷ 
õ 
ö Ûà€Ø€
Ø€Ø€	àÐ á‹8€à�E˜,¨°nÐDÑEÑFÓ FÞØ"�Mà €M÷ñ ÷$0ñ 0÷fNñ Nôb]'Ð,ô ]'ô@C*Ð#ô C*ôLSÐ.ô Sôlf�Jô fôRÐ!3ô ð> /€òð ØØ#ØØØØØ Ø!ØñÐ ò6ñr ˆeÐ+Ñ,€÷Oñ Oôd
g$˜^õ g$r9   