Ë
    UV.jÝ¢  ã                  ón  — d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	m
Z
 ddlmZ ddlmZmZ 	 ddlmZ d	ZddlmZ ddlmZ ddlmZ ddlmZmZ ddlmZ ddlm Z m!Z!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z(m)Z)m*Z*m+Z+ er(ddl,m-Z- ej\                  dk  rddl/m0Z0 nddlm0Z0 ddl1m2Z2 dZ3 ee4«      Z5e
Z6dddœZ7e6e#dœZ8ejr                  ju                  dd
«      Z;ejr                  ju                  dd
«      Z< G d„ d«      Z=e=Z> G d „ d!e=«      Z? G d"„ d#e«      Z@ G d$„ d%e«      ZAd(d&„ZBd)d'„ZCy# e$ r dZd
ZY Œùw xY w)*zClient (Connection).é    )ÚannotationsN)Úcontextmanager)ÚcountÚcycle)Ú
itemgetter)ÚTYPE_CHECKINGÚAny)Ú	CERT_NONETF)Ú
exceptionsé   )Ú
get_logger)ÚResource)Úget_transport_clsÚsupports_librabbitmq)Ú	HashedSeq)Ú
dictfilterÚlazyÚretry_over_timeÚshufflecycle)Úcached_property)Úas_urlÚmaybe_sanitize_urlÚ	parse_urlÚquoteÚurlparse)ÚChannel)é   é
   )Ú	TypeGuard)ÚTracebackType)Ú
ConnectionÚConnectionPoolÚChannelPoolÚamqp)ÚpyamqpÚlibrabbitmq)úround-robinÚshuffleÚKOMBU_LOG_CONNECTIONÚKOMBU_LOG_CHANNELc            	      ó  — e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZeZeZdxZxZxZxZZ	 	 	 	 	 	 dJd„Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Z dKd„Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&dLd„Z'd„ Z(e(Z)d„ Z*	 	 	 	 dMd„Z+e,e-j\                  e-j\                  fd„«       Z/e,d„ «       Z0d„ Z1d„ Z2	 	 	 dNd„Z3dLd„Z4d„ Z5d „ Z6d!„ Z7d"„ Z8dOd#„Z9d$„ Z:d%„ Z;dd& e<d'd(d)d*d+«      f	 dPd,„Z=dLd-„Z>dLd.„Z?dLd/„Z@dQd0„ZA	 	 	 dRd1„ZB	 	 	 dRd2„ZCd3„ ZDd4„ ZEd5„ ZFd6„ ZGd7„ ZHd8„ ZI	 	 	 	 	 	 	 	 dSd9„ZJeKd:„ «       ZLd;„ ZMeKd<„ «       ZNeKd=„ «       ZOd>„ ZPeKdTd?„«       ZQeKd@„ «       ZReKdA„ «       ZSeTdB„ «       ZUdC„ ZVeTdD„ «       ZWeTdE„ «       ZXeTdF„ «       ZYeTdG„ «       ZZeKdH„ «       Z[eKdI„ «       Z\y)Ur!   af
  A connection to the broker.

    Example:
    -------
        >>> Connection('amqp://guest:guest@localhost:5672//')
        >>> Connection('amqp://foo;amqp://bar',
        ...            failover_strategy='round-robin')
        >>> Connection('redis://', transport_options={
        ...     'visibility_timeout': 3000,
        ... })

        >>> import ssl
        >>> Connection('amqp://', login_method='EXTERNAL', ssl={
        ...    'ca_certs': '/etc/pki/tls/certs/something.crt',
        ...    'keyfile': '/etc/something/system.key',
        ...    'certfile': '/etc/something/system.cert',
        ...    'cert_reqs': ssl.CERT_REQUIRED,
        ... })

    Note:
    ----
        SSL currently only works with the py-amqp, qpid and redis
        transports.  For other transports you can use stunnel.

    Arguments:
    ---------
        URL (str, Sequence): Broker URL, or a list of URLs.

    Keyword Arguments:
    -----------------
        ssl (bool/dict): Use SSL to connect to the server.
            Default is ``False``.
            May not be supported by the specified transport.
        transport (Transport): Default transport if not specified in the URL.
        connect_timeout (float): Timeout in seconds for connecting to the
            server. May not be supported by the specified transport.
        transport_options (Dict): A dict of additional connection arguments to
            pass to alternate kombu channel implementations.  Consult the
            transport documentation for available options.
        heartbeat (float): Heartbeat interval in int/float seconds.
            Note that if heartbeats are enabled then the
            :meth:`heartbeat_check` method must be called regularly,
            around once per second.

    Note:
    ----
        The connection is established lazily when needed. If you need the
        connection to be established, then force it by calling
        :meth:`connect`::

            >>> conn = Connection('amqp://')
            >>> conn.connect()

        and always remember to close the connection::

            >>> conn.release()

    These options have been replaced by the URL argument, but are still
    supported for backwards compatibility:

    :keyword hostname: Host name/address.
        NOTE: You cannot specify both the URL argument and use the hostname
        keyword argument at the same time.
    :keyword userid: Default user name if not provided in the URL.
    :keyword password: Default password if not provided in the URL.
    :keyword virtual_host: Default virtual host if not provided in the URL.
    :keyword port: Default port if not provided in the URL.
    NÚ/é   Fr'   c                óî  — |€g n|}|||||||||	|||dœx}| _         |r8t        |t        «      s(|j                  |«       |d   }|j	                  |¬«       |rÐd|v r+|j                  d«      |z   }|d   }|j	                  |¬«       d|v r<d|d |j                  d«       v r&|j                  dd«      \  |d<   |d	<   |d   | _        nad|v r]|xs t        |«      j                  }t        |«      j                  s*t        |«      }|j	                  t        |«      |d	   ¬«       ||d<    | j                  di |¤Ž || _        |xs d
| _        | j"                  j%                  | j                   «      xs | j                   | _        | j                  r5| j'                  | j                  «      | _        t+        | j(                  «       |
€i }
|
| _        t.        rd| _        |r|| _        t3        «       | _        y )N)ÚhostnameÚuseridÚpasswordÚvirtual_hostÚportÚinsistÚsslÚ	transportÚconnect_timeoutÚlogin_methodÚ	heartbeatÚcredential_providerr   )r/   Ú;ú://Ú+r   r6   r/   r'   T© )Ú_initial_paramsÚ
isinstanceÚstrÚextendÚupdateÚsplitÚindexÚ
uri_prefixr   Úschemer   Úcan_parse_urlr   r   Ú_init_paramsÚaltÚ_failover_strategyÚfailover_strategiesÚgetÚfailover_strategyr   ÚnextÚtransport_optionsÚ_log_connectionÚ_loggerÚsetÚdeclared_entities)Úselfr/   r0   r1   r2   r3   r4   r5   r6   r7   rP   r8   rF   r9   rN   Ú
alternatesr:   ÚkwargsrJ   ÚparamsÚ
url_paramss                        úRC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\kombu/connection.pyÚ__init__zConnection.__init__©   s  € ð Ð&‰b¨Jˆð !¨FØ °,Ø F°3Ø"°Ø(°yØ#6ñ)
ð 	
ˆ�Ô%ñ œJ x´Ô5Ø�J‰J�xÔ Ø˜1‘vˆHØ�M‰M 8ˆMÔ,ÙØ�h‰Ø—n‘n SÓ)¨CÑ/�Ø˜q™6�Ø—‘ x�Ô0Ø˜Ñ  S¨HÐ5K°h·n±nÀUÓ6KÐ,LÑ%Lð —N‘N 3¨Ó*ñ 8��{Ñ# V¨JÑ%7à"(¨Ñ"5�•Ø˜(Ñ"Ø%ÒB¬°(Ó);×)BÑ)B�	Ü(¨Ó3×AÒAä!*¨8Ó!4�JØ—M‘MÜ" :Ó.Ø!+¨JÑ!7ð "ô ð
 '0��{Ñ#àˆ×ÑÑ#˜FÒ#ð ˆŒð #4Ò"D°}ˆÔØ!%×!9Ñ!9×!=Ñ!=Ø×#Ñ#ó"%ò "@Ø(,×(?Ñ(?ð 	Ôà�8Š8Ø×/Ñ/°·±Ó9ˆDŒJÜ�—‘ÔàÐ$Ø "ÐØ!2ˆÔåØˆDŒLáØ(ˆDŒOä!$£ˆÕó    c           	     óØ   — | j                  «        | j                  j                  «        d| _        d|v rt	        |«      nd|i} | j
                  di t        | j                  fi |¤Ž¤Ž y)zÛSwitch connection parameters to use a new URL or hostname.

        Note:
        ----
            Does not reconnect!

        Arguments:
        ---------
            conn_str (str): either a hostname or URL.
        Fr<   r/   Nr>   )ÚcloserT   ÚclearÚ_closedr   rI   Údictr?   )rU   Úconn_strÚconn_paramss      rZ   ÚswitchzConnection.switchî   sf   € ð 	�
‰
ŒØ×Ñ×$Ñ$Ô&ØˆŒà#(¨HÑ#4ŒI�hÔ¸:ÀxÐ:Pð 	ð 	ˆ×ÑÑFœD ×!5Ñ!5ÑE¸ÑEÓFr\   c                óf   — | j                   r%| j                  t        | j                   «      «       yy)z:Switch to next URL given by the current failover strategy.N)r   rd   rO   ©rU   s    rZ   Úmaybe_switch_nextzConnection.maybe_switch_next  s#   € à�:Š:Ø�K‰Kœ˜TŸZ™ZÓ(Õ)ð r\   c                ó€  — |xs d}|dk(  rt        «       rd}|dk(  r%t        r|st        j                  d«       dt        i}|| _        || _        || _        |
| _        |xs | j                  | _	        |xs | j                  | _
        || _        |	| _        || _        || _        |xr t        |«      | _        || _        y )Nr$   r&   ÚredisszaSecure redis scheme specified (rediss) with no ssl options, defaulting to insecure SSL behaviour.Ússl_cert_reqs)r   Ússl_availableÚloggerÚwarningr
   r/   r0   r1   r8   r2   r3   r4   r7   r5   Útransport_clsÚfloatr9   r:   )rU   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   s                rZ   rI   zConnection._init_params  sÂ   € ð Ò' ˆ	Ø˜ÒÔ#7Ô#9Ø%ˆIØ˜Ò ¥]¹3Ü�N‰NðAôð #¤IÐ.ˆCØ ˆŒØˆŒØ ˆŒØ(ˆÔØ(Ò=¨D×,=Ñ,=ˆÔØÒ%˜DŸI™IˆŒ	ØˆŒØ.ˆÔØˆŒØ&ˆÔØ"Ò7¤u¨YÓ'7ˆŒØ#6ˆÕ r\   c                óP   — | j                   j                  | j                  |«       y ©N)r6   Úregister_with_event_loopÚ
connection)rU   Úloops     rZ   rr   z#Connection.register_with_event_loop  s   € Ø�‰×/Ñ/°·±ÀÕFr\   c                óš   — | j                   r?d}t        j                  |j                  t	        | «      t        |«      ¬«      g|¢­i |¤Ž y y )Nz [Kombu connection:{id:#x}] {msg})ÚidÚmsg)rR   rl   ÚdebugÚformatrv   rA   )rU   rw   ÚargsrW   Úfmts        rZ   Ú_debugzConnection._debug"  sF   € Ø�<Š<Ø4ˆCÜ�L‰L˜Ÿ™¤r¨$£x´S¸³X˜Ó>ð *Øò*Ø"(ó*ð r\   c                ó(   — | j                  dd¬«      S )z+Establish connection to server immediately.r   F©Úmax_retriesÚreraise_as_library_errors©Ú_ensure_connectionrf   s    rZ   ÚconnectzConnection.connect(  s   € à×&Ñ&Ø°Uð 'ó 
ð 	
r\   c                óž   — | j                  d«       | j                  j                  | j                  «      }t        rddlm}  ||dd«      S |S )z Create and return a new channel.zcreate channelr   )Ú
Logwrappedzkombu.channelz[Kombu channel:{0.channel_id}] )r|   r6   Úcreate_channelrs   Ú_log_channelÚutils.debugr…   )rU   Úchanr…   s      rZ   ÚchannelzConnection.channel.  sH   € à�‰Ð$Ô%Ø�~‰~×,Ñ,¨T¯_©_Ó=ˆÝÝ/Ù˜d OØ?óAð Aàˆr\   c                óP   — | j                   j                  | j                  |¬«      S )aˆ  Check heartbeats.

        Allow the transport to perform any periodic tasks
        required to make heartbeats work.  This should be called
        approximately every second.

        If the current transport does not support heartbeats then
        this is a noop operation.

        Arguments:
        ---------
            rate (int): Rate is how often the tick is called
                compared to the actual heartbeat value.  E.g. if
                the heartbeat is set to 3 seconds, and the tick
                is called every 3 / 2 seconds, then the rate is 2.
                This value is currently unused by any transports.
        )Úrate)r6   Úheartbeat_checkrs   )rU   rŒ   s     rZ   r�   zConnection.heartbeat_check8  s"   € ð$ �~‰~×-Ñ-¨d¯o©oÀDÐ-ÓIÐIr\   c                óP   —  | j                   j                  | j                  fi |¤ŽS )zñWait for a single event from the server.

        Arguments:
        ---------
            timeout (float): Timeout in seconds before we give up.

        Raises
        ------
            socket.timeout: if the timeout is exceeded.
        )r6   Údrain_eventsrs   ©rU   rW   s     rZ   r�   zConnection.drain_eventsL  s$   € ð +ˆt�~‰~×*Ñ*¨4¯?©?ÑE¸fÑEÐEr\   c                ój   — 	 |j                  «        y# | j                  | j                  z   $ r Y yw xY w)z>Close given channel, but ignore connection and channel errors.N)r^   Úconnection_errorsÚchannel_errors©rU   rŠ   s     rZ   Úmaybe_close_channelzConnection.maybe_close_channelY  s3   € ð	Ø�M‰M�OøØ×&Ñ&¨×)<Ñ)<Ñ<ò 	Ùð	ús   ‚ “2±2c                óR  — | j                   j                  «        | j                  r| j                  | j                  «       | j                  r.	 | j
                  j                  | j                  «       d | _        y y # | j                  t        t        j                  fz   $ r Y Œ1w xY wrq   )rT   r_   Ú_default_channelr•   Ú_connectionr6   Úclose_connectionr’   ÚAttributeErrorÚsocketÚerrorrf   s    rZ   Ú_do_close_selfzConnection._do_close_self`  sŽ   € à×Ñ×$Ñ$Ô&Ø× Ò Ø×$Ñ$ T×%:Ñ%:Ô;Ø×ÒðØ—‘×/Ñ/°×0@Ñ0@ÔAð  $ˆDÕð øð ×)Ñ)¬^¼V¿\¹\Ð,JÑJò Ùðús   Á%A= Á=&B&Â%B&c                ót   — | j                  «        | j                  «        | j                  d«       d| _        y)z;Really close connection, even if part of a connection pool.ÚclosedTN)r�   Ú_do_close_transportr|   r`   rf   s    rZ   Ú_closezConnection._closel  s-   € à×ÑÔØ× Ñ Ô"Ø�‰�HÔØˆ�r\   c                óN   — | j                   rd | j                   _        d | _         y y rq   )Ú
_transportÚclientrf   s    rZ   r    zConnection._do_close_transports  s!   € Ø�?Š?Ø%)ˆD�O‰OÔ"Ø"ˆD�Oð r\   c                óÞ  — 	 | j                   j                  } || j                  «       | j                  «        | j                  j                  «        d | _        y # t        $ r‡ t	        j
                  «       }t	        j                  |«       	 | j                  «        n# t        j                  $ r Y nw xY wt	        j                  |«       n# t	        j                  |«       w xY wY ŒÁw xY wrq   )r£   Ú_collectr˜   rš   r›   ÚgetdefaulttimeoutÚsetdefaulttimeoutr�   Útimeoutr    rT   r_   )rU   Úsocket_timeoutÚgc_transportÚ_timeos       rZ   ÚcollectzConnection.collectx  sÂ   € ð	+ØŸ?™?×3Ñ3ˆLñ ˜×)Ñ)Ô*à× Ñ Ô"Ø×Ñ×$Ñ$Ô&ØˆÕøô ò 	1Ü×-Ñ-Ó/ˆFÜ×$Ñ$ ^Ô4ð1Ø×#Ñ#Õ%øÜ—>‘>ò Ùðúô ×(Ñ(¨Õ0ø”×(Ñ(¨Õ0úÑ0ð	1úsG   ‚A Á2C,ÂB ÂCÂ B6Â3CÂ5B6Â6CÂ9C,ÃC&Ã&C,Ã+C,c                ó$   — | j                  «        y)zClose the connection (if open).N©r¡   rf   s    rZ   ÚreleasezConnection.releaseŽ  s   € à�‰�r\   c                ó*   —  | j                   |i |¤Ž | S )ztPublic interface of _ensure_connection for retro-compatibility.

        Returns kombu.Connection instance.
        r�   ©rU   rz   rW   s      rZ   Úensure_connectionzConnection.ensure_connection“  s   € ð
 	 ˆ×Ñ Ð0¨Ò0Øˆr\   c	                ó  ‡ ‡— ‰ j                   r‰ j                  S dˆˆ fd„	}	‰ j                  }
|s‰ j                  }
 |
«       5  t	        ‰ j
                  ‰ j                  di |	||||||¬«      cddd«       S # 1 sw Y   yxY w)a‚  Ensure we have a connection to the server.

        If not retry establishing the connection with the settings
        specified.

        Arguments:
        ---------
            errback (Callable): Optional callback called each time the
                connection can't be established.  Arguments provided are
                the exception raised and the interval that will be
                slept ``(exc, interval)``.

            max_retries (int): Maximum number of times to retry.
                If this limit is exceeded the connection error
                will be re-raised.

            interval_start (float): The number of seconds we start
                sleeping for.
            interval_step (float): How many seconds added to the interval
                for each retry.
            interval_max (float): Maximum number of seconds to sleep between
                each retry.
            callback (Callable): Optional callback that is called for every
                internal iteration (1 s).
            timeout (int): Maximum amount of time in seconds to spend
                attempting to connect, total over all retries.
        c                ó‚   •— ‰j                  |«      }|rt        |«      }‰r	 ‰| |«       ‰j                  «        |r|S dS ©Nr   )Úcompletes_cyclerO   rg   )ÚexcÚ	intervalsÚretriesÚintervalÚroundÚerrbackrU   s        €€rZ   Úon_errorz/Connection._ensure_connection.<locals>.on_error¿  sE   ø€ Ø×(Ñ(¨Ó1ˆEÙÜ 	›?�ÙÙ˜˜XÔ&Ø×"Ñ"Ô$á$�8Ð+¨!Ð+r\   r>   )r©   N)r   )Ú	connectedr˜   Ú_reraise_as_library_errorsÚ_dummy_contextr   Ú_connection_factoryÚrecoverable_connection_errors)rU   r½   r   Úinterval_startÚinterval_stepÚinterval_maxÚcallbackr€   r©   r¾   Úctxs   ``         rZ   r‚   zConnection._ensure_connection›  sv   ù€ ðB �>Š>Ø×#Ñ#Ð#ö	,ð ×-Ñ-ˆÙ(Ø×%Ñ%ˆCÙ�UÜ"Ø×(Ñ(¨$×*LÑ*LØ�B˜ +Ø ¨|Ø 'ô	÷ �UŠUús   Á*A7Á7B c              #  ó¾   K  — 	 d –— y # ||f$ r ‚ | j                   $ r} |t        |«      «      |‚d }~w| j                  $ r} |t        |«      «      |‚d }~ww xY w­wrq   )rÃ   rA   Úrecoverable_channel_errors)rU   ÚConnectionErrorÚChannelErrorr¸   s       rZ   rÀ   z%Connection._reraise_as_library_errorsÔ  sd   è ø€ ð
	2ÜøØ Ð.ò 	ØØ×1Ñ1ò 	5Ù!¤# c£(Ó+°Ð4ûØ×.Ñ.ò 	2Ùœs 3›xÓ(¨cÐ1ûð	2üs.   ‚A„	 ˆA‰AŸ1±AÁAÁAÁAc              #  ó   K  — d –— y ­wrq   r>   rf   s    rZ   rÁ   zConnection._dummy_contextâ  s	   è ø€ äùs   ‚c                óV   — | j                   r|dz   t        | j                   «      z   S dS )z?Return true if the cycle is complete after number of `retries`.r   T)rJ   Úlen)rU   rº   s     rZ   r·   zConnection.completes_cycleæ  s'   € à48·H²H�G˜a‘K¤3 t§x¡x£=Ñ0Ð0ÐFÀ$ÐFr\   c                ó€   — | j                   r2|| j                   ur#| j                  | j                   «       d| _         yyy)z2Revive connection after connection re-established.N)r—   r•   )rU   Únew_channels     rZ   ÚrevivezConnection.reviveê  s=   € à× Ò  [¸×8MÑ8MÑ%MØ×$Ñ$ T×%:Ñ%:Ô;Ø$(ˆDÕ!ð &NÐ r\   c
           
     óº   ‡ ‡‡‡‡‡‡‡‡‡	— ‰	€
t        «       Š	ˆˆˆˆˆˆˆˆˆ	ˆ f
d„}
‰j                  › d�|
_        ‰j                  |
_        ‰j                  |
_        |
S )a.  Ensure operation completes.

        Regardless of any channel/connection errors occurring.

        Retries by establishing the connection, and reapplying
        the function.

        Arguments:
        ---------
            obj: The object to ensure an action on.
            fun (Callable): Method to apply.

            errback (Callable): Optional callback called each time the
                connection can't be established.  Arguments provided are
                the exception raised and the interval that will
                be slept ``(exc, interval)``.

            max_retries (int): Maximum number of times to retry.
                If this limit is exceeded the connection error
                will be re-raised.

            interval_start (float): The number of seconds we start
                sleeping for.
            interval_step (float): How many seconds added to the interval
                for each retry.
            interval_max (float): Maximum number of seconds to sleep between
                each retry.
            on_revive (Callable): Optional callback called whenever
                revival completes successfully
            retry_errors (tuple): Optional list of errors to retry on
                regardless of the connection state.

        Examples
        --------
            >>> from kombu import Connection, Producer
            >>> conn = Connection('amqp://')
            >>> producer = Producer(conn)

            >>> def errback(exc, interval):
            ...     logger.error('Error: %r', exc, exc_info=1)
            ...     logger.info('Retry in %s seconds.', interval)

            >>> publish = conn.ensure(producer, producer.publish,
            ...                       errback=errback, max_retries=3)
            >>> publish({'hello': 'world'}, routing_key='dest')
        c                 ó  •
— d}‰j                   }‰j                  }t        ‰j                  d«      }‰j	                  «       5  t        d«      D ]  }	  ‰| i |¤Žc cd d d «       S  	 d d d «       y # ‰$ r&}‰�|‰k\  r‚ ‰j                  d|d¬«       Y d }~ŒHd }~w|$ rž}|r|s‚ ‰�|‰k\  r‚ ‰j                  d|d¬«       ‰j                  «        ‰
xr	  ‰
|d«       d }‰�t        ‰|z
  d«      }‰j                  ‰
|‰‰‰d¬«       ‰j                  }	‰j                  |	«       ‰r ‰|	«       |dz  }Y d }~Œéd }~w|$ r4}‰�|‰kD  r‚ ‰j                  d	|d¬«       ‰
xr	  ‰
|d«       Y d }~�Œ d }~ww xY w# 1 sw Y   y xY w)
Nr   rÃ   zensure retry policy error: %rr   )Úexc_infozensure connection error: %rF)r€   zensure channel error: %r)rÃ   rÊ   Úhasattrr6   rÀ   r   r|   r­   Úmaxr‚   Údefault_channelrÒ   )rz   rW   Úgot_connectionÚconn_errorsÚchan_errorsÚhas_modern_errorsrº   r¸   Úremaining_retriesrŠ   r½   ÚfunrÆ   rÄ   rÅ   r   ÚobjÚ	on_reviveÚretry_errorsrU   s             €€€€€€€€€€rZ   Ú_ensuredz#Connection.ensure.<locals>._ensured$  sÁ  ø€ ØˆNØ×<Ñ<ˆKØ×9Ñ9ˆKÜ 'Ø—‘Ð ?ó!Ðð ×0Ñ0Õ2Ü$ Qžx�Gð'4Ù" DÐ3¨FÑ3Ñ3÷ 3Ñ2Ù'÷ 3Ð2øð (ò 5Ø&Ð2°wÀ+Ò7MØ!ØŸ™Ð$CØ$'°!ð $÷ 5ñ 5ûà&ò ,Ù)Ñ2Cð
 "Ø&Ð2°wÀ+Ò7MØ!ØŸ™Ð$AØ$'°!ð $ô 5àŸ™œØÒ3¡G¨C°£OøØ,0Ð)Ø&Ð2Ü03°KÀ'Ñ4IÈ1Ó0MÐ-Ø×/Ñ/Ø#Ø-Ø*¨M¸<Ø6;ð	 0ô ð #'×"6Ñ"6˜ØŸ
™
 7Ô+Ù$Ù% gÔ.Ø&¨!Ñ+�ûØ&ò 4Ø&Ð2°wÀÒ7LØ!ØŸ™Ð$>Ø$'°!ð $ô 5àÒ3¡G¨C°£Oÿúð4ú÷I 3Ð2úsa   ÁE6ÁA0ÁE6Á%E6Á0E3Á5BÂE6ÂE3ÂBD7Ä2E6Ä7E3Ä?)E.Å(E6Å.E3Å3E6Å6E?z	(ensured))ÚtupleÚ__name__Ú__doc__Ú
__module__)rU   rß   rÞ   r½   r   rÄ   rÅ   rÆ   rà   rá   râ   s   `````````` rZ   ÚensurezConnection.ensureð  sQ   ÿù€ ðb ÐÜ ›7ˆL÷0	4õ 0	4ðb  #Ÿ|™|˜n¨IÐ6ˆÔØŸ;™;ˆÔØ!Ÿn™nˆÔØˆr\   c                ó^   ‡‡— |gŠ G ˆˆfd„d«      } || «      } | j                   ||fi |¤ŽS )a  Decorator for functions supporting a ``channel`` keyword argument.

        The resulting callable will retry calling the function if
        it raises connection or channel related errors.
        The return value will be a tuple of ``(retval, last_created_channel)``.

        If a ``channel`` is not provided, then one will be automatically
        acquired (remember to close it afterwards).

        See Also
        --------
            :meth:`ensure` for the full list of supported keyword arguments.

        Example:
        -------
            >>> channel = connection.channel()
            >>> try:
            ...    ret, channel = connection.autoretry(
            ...         publish_messages, channel)
            ... finally:
            ...    channel.close()
        c                  ól   •— e Zd Z eW °dd«      Z  eW °dd«      Z eW °dd«      Zd„ Zˆ fd„Zˆ ˆfd„Zy)ú%Connection.autoretry.<locals>.Revivalrä   Nræ   rå   c                ó   — || _         y rq   )rs   )rU   rs   s     rZ   r[   z.Connection.autoretry.<locals>.Revival.__init__x  s	   € Ø",�•r\   c                ó   •— |‰d<   y r¶   r>   )rU   rŠ   Úchannelss     €rZ   rÒ   z,Connection.autoretry.<locals>.Revival.revive{  s   ø€ Ø%�˜’r\   c                ó|   •— ‰d   €%| j                  | j                  j                  «        ‰|d‰d   i|¤Ž‰d   fS )Nr   rŠ   )rÒ   rs   rØ   )rU   rz   rW   rí   rÞ   s      €€rZ   Ú__call__z.Connection.autoretry.<locals>.Revival.__call__~  sE   ø€ Ø˜A‘;Ð&Ø—K‘K §¡× ?Ñ ?Ô@Ù˜DÐ@¨(°1©+Ð@¸Ñ@À(È1Á+ÐMÐMr\   )rä   ræ   Ú__qualname__Úgetattrrå   r[   rÒ   rï   )rí   rÞ   s   €€rZ   ÚRevivalrê   s  s=   ø„ Ù™s J°Ó5ˆHÙ ¡ l°DÓ9ˆJÙ™c 9¨dÓ3ˆGò-ô&öNr\   rò   )rç   )rU   rÞ   rŠ   Úensure_optionsrò   rÒ   rí   s    `    @rZ   Ú	autoretryzConnection.autoretryZ  s;   ù€ ð. �9ˆ÷	Nô 	Nñ  ˜“ˆØˆt�{‰{˜6 6Ñ<¨^Ñ<Ð<r\   c                ó0   —  | j                  «       | ¬«      S )N)r¤   )r   rf   s    rZ   Úcreate_transportzConnection.create_transport†  s   € Ø'ˆt×%Ñ%Ó'¨tÔ4Ð4r\   c                óX   — | j                   }|rt        |t        «      rt        |«      }|S )z'Get the currently used transport class.)rn   r@   rA   r   )rU   rn   s     rZ   r   zConnection.get_transport_cls‰  s)   € à×*Ñ*ˆÙ¤
¨=¼#Ô >Ü-¨mÓ<ˆMØÐr\   c           	     óZ   —  | j                   di t        | j                  d¬«      fi |¤Ž¤ŽS )z3Create a copy of the connection with same settings.F©Úresolver>   )Ú	__class__ra   Ú_infor�   s     rZ   ÚclonezConnection.clone�  s+   € àˆt�~‰~ÑJ¤ T§Z¡Z¸ ZÓ%>Ñ IÀ&Ñ IÑJÐJr\   c                óL   — | j                   j                  | j                  «      S rq   )r6   Úget_heartbeat_intervalrs   rf   s    rZ   rÿ   z!Connection.get_heartbeat_interval”  s   € Ø�~‰~×4Ñ4°T·_±_ÓEÐEr\   c                óÀ  — | j                   }|r| j                  j                  ||«      }| j                  j                  }| j
                  sK|j                  d«      r:t        j                  d|j                  d«      › d�«       |j                  d«      }n| j
                  }| j                  r| j                  › d|› �}d|fd| j                  xs |j                  d«      fd| j                  xs |j                  d«      fd| j                  xs |j                  d«      fd| j                  xs |j                  d«      fd	| j                  fd
| j                  fd|fd| j                  fd| j                   fd| j"                  xs |j                  d«      fd| j                  fd| j$                  fd| j&                  fd| j(                  fd| j*                  ff}|S )Nr/   z0No hostname was supplied. Reverting to default 'Ú'r=   r0   r1   r2   r3   r4   r5   r6   r7   rP   r8   rF   r9   rN   rV   r:   )rn   Úresolve_aliasesrM   r6   Údefault_connection_paramsr/   rl   rm   rF   r0   r1   r2   r3   r4   r5   r7   rP   r8   r9   rK   rJ   r:   )rU   rú   rn   ÚDr/   Úinfos         rZ   rü   zConnection._info—  sÀ  € Ø×*Ñ*ˆÙØ ×0Ñ0×4Ñ4Ø˜}ó.ˆMà�N‰N×4Ñ4ˆà�}Š} §¡ zÔ!2Ü�N‰Nð)Ø)*¯©¨zÓ):Ð(;¸1ð>ô?ð —u‘u˜ZÓ(‰Hà—}‘}ˆHà�?Š?ØŸ/™/Ð*¨!¨H¨:Ð6ˆHð ˜Ð"Ø�t—{‘{Ò5 a§e¡e¨H£oÐ6Ø˜Ÿ™Ò;¨!¯%©%°
Ó*;Ð<Ø˜T×.Ñ.ÒG°!·%±%¸Ó2GÐHØ�T—Y‘YÒ/ !§%¡%¨£-Ð0Ø�t—{‘{Ð#Ø�D—H‘HÐØ˜-Ð(Ø × 4Ñ 4Ð5Ø  $×"8Ñ"8Ð9Ø˜T×.Ñ.ÒG°!·%±%¸Ó2GÐHØ˜4Ÿ?™?Ð+Ø˜$Ÿ.™.Ð)Ø  $×"9Ñ"9Ð:Ø˜4Ÿ8™8Ð$Ø" D×$<Ñ$<Ð=ð!
ˆð$ ˆr\   c                ó4   — t        | j                  «       «      S )zGet connection info.)ra   rü   rf   s    rZ   r  zConnection.info½  s   € ä�D—J‘J“LÓ!Ð!r\   c                óÂ   — t        | j                  | j                  | j                  | j                  | j
                  | j                  t        | j                  «      «      S rq   )	r   rn   r/   r0   r1   r2   r3   ÚreprrP   rf   s    rZ   Ú
__eqhash__zConnection.__eqhash__Á  sF   € Ü˜×+Ñ+¨T¯]©]¸D¿K¹KØŸ™¨×(9Ñ(9¸4¿9¹9Ü˜d×4Ñ4Ó5ó7ð 	7r\   z**r3   r0   r1   r2   r6   c           
     óæ  — | j                   xs d}| j                  j                  r*| j                   }	 | j                  j                  |||«      S | j
                  r | j
                  › d|› �}|st        |«      }|S | j                  «       } ||«      \  }}}	}
}t        |||||	t        |
«      | |¬«      S # t        $ r Y nw xY w| j
                  r| j
                  › d|› �}|st        |«      }|S )z*Convert connection parameters to URL form.Ú	localhostr=   )ÚsanitizeÚmask)
r/   r6   rH   Úas_uriÚNotImplementedErrorrF   r   r  r   r   )rU   Úinclude_passwordr  Ú	getfieldsr/   Úconnection_as_uriÚfieldsr3   r0   r1   Úvhostr6   s               rZ   r  zConnection.as_uriÆ  s  € ð —=‘=Ò/ KˆØ�>‰>×'Ò'Ø $§¡ÐðØ—~‘~×,Ñ,Ø%Ð'7¸ó?ð ?ð �?Š?Ø#'§?¡?Ð"3°1°X°JÐ ?ÐÙ#Ü$6Ð7HÓ$IÐ!Ø$Ð$Ø—‘“ˆÙ3<¸VÓ3DÑ0ˆˆf�h  yäØ�x  v¨x¼¸u»Ø)Ð)°ô
ð 	
øô! 'ò Ùðúð �ŠØ'+§¡Ð&7°q¸¸
Ð$CÐ!Ù#Ü$6Ð7HÓ$IÐ!Ø$Ð$s   ´B8 Â8	CÃCc                ó   — t        | |fi |¤ŽS )a/  Pool of connections.

        See Also
        --------
            :class:`ConnectionPool`.

        Arguments:
        ---------
            limit (int): Maximum number of active connections.
                Default is no limit.

        Example:
        -------
            >>> connection = Connection('amqp://')
            >>> pool = connection.Pool(2)
            >>> c1 = pool.acquire()
            >>> c2 = pool.acquire()
            >>> c3 = pool.acquire()
            Traceback (most recent call last):
              File "<stdin>", line 1, in <module>
              File "kombu/connection.py", line 354, in acquire
              raise ConnectionLimitExceeded(self.limit)
                kombu.exceptions.ConnectionLimitExceeded: 2
            >>> c1.release()
            >>> c3 = pool.acquire()
        )r"   ©rU   ÚlimitrW   s      rZ   ÚPoolzConnection.Poolå  s   € ô6 ˜d EÑ4¨VÑ4Ð4r\   c                ó   — t        | |fi |¤ŽS )a'  Pool of channels.

        See Also
        --------
            :class:`ChannelPool`.

        Arguments:
        ---------
            limit (int): Maximum number of active channels.
                Default is no limit.

        Example:
        -------
            >>> connection = Connection('amqp://')
            >>> pool = connection.ChannelPool(2)
            >>> c1 = pool.acquire()
            >>> c2 = pool.acquire()
            >>> c3 = pool.acquire()
            Traceback (most recent call last):
              File "<stdin>", line 1, in <module>
              File "kombu/connection.py", line 354, in acquire
              raise ChannelLimitExceeded(self.limit)
                kombu.connection.ChannelLimitExceeded: 2
            >>> c1.release()
            >>> c3 = pool.acquire()
        )r#   r  s      rZ   r#   zConnection.ChannelPool  s   € ô6 ˜4 Ñ1¨&Ñ1Ð1r\   c                ó.   — ddl m}  ||xs | g|¢­i |¤ŽS )z,Create new :class:`kombu.Producer` instance.r   )ÚProducer)Ú	messagingr  )rU   rŠ   rz   rW   r  s        rZ   r  zConnection.Producer  s   € å'Ù˜š 4Ð9¨$Ò9°&Ñ9Ð9r\   c                ó0   — ddl m}  ||xs | |g|¢­i |¤ŽS )z,Create new :class:`kombu.Consumer` instance.r   )ÚConsumer)r  r  )rU   ÚqueuesrŠ   rz   rW   r  s         rZ   r  zConnection.Consumer$  s    € å'Ù˜š 4¨ÐA°$ÒA¸&ÑAÐAr\   c                ó2   — ddl m}  ||xs | |||||fi |¤ŽS )aµ  Simple persistent queue API.

        Create new :class:`~kombu.simple.SimpleQueue`, using a channel
        from this connection.

        If ``name`` is a string, a queue and exchange will be automatically
        created using that name as the name of the queue and exchange,
        also it will be used as the default routing key.

        Arguments:
        ---------
            name (str, kombu.Queue): Name of the queue/or a queue.
            no_ack (bool): Disable acknowledgments. Default is false.
            queue_opts (Dict): Additional keyword arguments passed to the
                constructor of the automatically created :class:`~kombu.Queue`.
            queue_args (Dict): Additional keyword arguments passed to the
                constructor of the automatically created :class:`~kombu.Queue`
                for setting implementation extensions (e.g., in RabbitMQ).
            exchange_opts (Dict): Additional keyword arguments passed to the
                constructor of the automatically created
                :class:`~kombu.Exchange`.
            channel (ChannelT): Custom channel to use. If not specified the
                connection default channel is used.
        r   )ÚSimpleQueue)Úsimpler!  )	rU   ÚnameÚno_ackÚ
queue_optsÚ
queue_argsÚexchange_optsrŠ   rW   r!  s	            rZ   r!  zConnection.SimpleQueue)  s.   € õ6 	(Ù˜7š? d¨D°&¸*Ø%Ø(ñ4à,2ñ4ð 	4r\   c                ó2   — ddl m}  ||xs | |||||fi |¤ŽS )aÑ  Simple ephemeral queue API.

        Create new :class:`~kombu.simple.SimpleQueue` using a channel
        from this connection.

        See Also
        --------
            Same as :meth:`SimpleQueue`, but configured with buffering
            semantics. The resulting queue and exchange will not be durable,
            also auto delete is enabled. Messages will be transient (not
            persistent), and acknowledgments are disabled (``no_ack``).
        r   )ÚSimpleBuffer)r"  r)  )	rU   r#  r$  r%  r&  r'  rŠ   rW   r)  s	            rZ   r)  zConnection.SimpleBufferI  s.   € õ 	)Ù˜GšO t¨T°6¸:Ø&Ø)ñ5à-3ñ5ð 	5r\   c                ó€   — | j                  d«       | j                  j                  «       }| j                  d| «       |S )Nzestablishing connection...zconnection established: %r)r|   r6   Úestablish_connection)rU   Úconns     rZ   Ú_establish_connectionz Connection._establish_connection]  s5   € Ø�‰Ð0Ô1Ø�~‰~×2Ñ2Ó4ˆØ�‰Ð0°$Ô7Øˆr\   c                óF   — || j                   j                  j                  v S rq   )r6   Ú
implementsÚexchange_type)rU   r0  s     rZ   Úsupports_exchange_typez!Connection.supports_exchange_typec  s   € Ø §¡× 9Ñ 9× GÑ GÐGÐGr\   c                óD   — d| j                  «       › dt        | «      d›d�S )Nz<Connection: z at z#xÚ>)r  rv   rf   s    rZ   Ú__repr__zConnection.__repr__f  s#   € Ø˜tŸ{™{›}˜o¨T´"°T³(¸2°¸aÐ@Ð@r\   c                ó"   — | j                  «       S rq   )rý   rf   s    rZ   Ú__copy__zConnection.__copy__i  s   € Ø�z‰z‹|Ðr\   c                ój   — | j                   t        | j                  «       j                  «       «      d fS rq   )rû   rã   r  Úvaluesrf   s    rZ   Ú
__reduce__zConnection.__reduce__l  s'   € Ø�~‰~œu T§Y¡Y£[×%7Ñ%7Ó%9Ó:¸DÐ@Ð@r\   c                ó   — | S rq   r>   rf   s    rZ   Ú	__enter__zConnection.__enter__o  ó   € Øˆr\   c                ó$   — | j                  «        y rq   )r°   )rU   Úexc_typeÚexc_valÚexc_tbs       rZ   Ú__exit__zConnection.__exit__r  s   € ð 	�‰�r\   c                óL   — | j                   j                  | j                  «      S rq   )r6   Úqos_semantics_matches_specrs   rf   s    rZ   rC  z%Connection.qos_semantics_matches_specz  s   € à�~‰~×8Ñ8¸¿¹ÓIÐIr\   c                óæ   — d| j                   i}| j                  }|rTd|v r|d   |d<   d|v r|d   |d<   d|v r|d   |d<   d|v r|d   |d<   d|v r|d   |d<   d|v r|d   |d<   d|v r|d   |d<   |S )	Nr©   r   rÄ   rÅ   rÆ   Úconnect_retries_timeoutr½   rÇ   )r7   rP   )rU   Ú	conn_optsÚtransport_optss      rZ   Ú_extract_failover_optsz!Connection._extract_failover_opts~  sÍ   € Ø × 4Ñ 4Ð5ˆ	Ø×/Ñ/ˆÙØ Ñ.Ø+9¸-Ñ+H�	˜-Ñ(Ø >Ñ1Ø.<Ð=MÑ.N�	Ð*Ñ+Ø .Ñ0Ø-;¸OÑ-L�	˜/Ñ*Ø Ñ/Ø,:¸>Ñ,J�	˜.Ñ)Ø(¨NÑ:à"Ð#<Ñ=ð ˜)Ñ$à˜NÑ*Ø'5°iÑ'@�	˜)Ñ$Ø˜^Ñ+Ø(6°zÑ(B�	˜*Ñ%ØÐr\   c                óŠ   — | j                    xr5 | j                  duxr% | j                  j                  | j                  «      S )z3Return true if the connection has been established.N)r`   r˜   r6   Úverify_connectionrf   s    rZ   r¿   zConnection.connected“  sF   € ð —L‘LÐ ò CØ× Ñ ¨Ð,òCà—‘×0Ñ0°×1AÑ1AÓBð	Dr\   c                ór   — | j                   s+| j                  s| j                  dd¬«      S | j                  S y)z»The underlying connection object.

        Warning:
        -------
            This instance is transport specific, so do not
            depend on the interface of this object.
        r   Fr~   N)r`   r¿   r‚   r˜   rf   s    rZ   rs   zConnection.connectionš  sB   € ð �|Š|Ø—>’>Ø×.Ñ.Ø !¸Uð /ó ð ð ×#Ñ#Ð#ð r\   c                ó”   — | j                   j                  «        d | _        | j                  «       | _        d| _        | j                  S )NF)rT   r_   r—   r-  r˜   r`   rf   s    rZ   rÂ   zConnection._connection_factoryª  s@   € Ø×Ñ×$Ñ$Ô&Ø $ˆÔØ×5Ñ5Ó7ˆÔØˆŒØ×ÑÐr\   c                ó    — | j                  «       } | j                  di |¤Ž | j                  €| j                  «       | _        | j                  S )aw  Default channel.

        Created upon access and closed when the connection is closed.

        Note:
        ----
            Can be used for automatic channel handling when you only need one
            channel, and also it is the channel implicitly used if
            a connection is passed instead of a channel, to functions that
            require a channel.
        r>   )rH  r‚   r—   rŠ   )rU   rF  s     rZ   rØ   zConnection.default_channel±  sK   € ð ×/Ñ/Ó1ˆ	Øˆ×ÑÑ, )Ò,à× Ñ Ð(Ø$(§L¡L£NˆDÔ!Ø×$Ñ$Ð$r\   c                ób   — dj                  | j                  t        | j                  «      g«      S )z5The host as a host name/port pair separated by colon.Ú:)Újoinr/   rA   r3   rf   s    rZ   ÚhostzConnection.hostÆ  s$   € ð �x‰x˜Ÿ™¬¨D¯I©I«Ð7Ó8Ð8r\   c                ó\   — | j                   €| j                  «       | _         | j                   S rq   )r£   rö   rf   s    rZ   r6   zConnection.transportË  s&   € à�?‰?Ð"Ø"×3Ñ3Ó5ˆDŒOØ�‰Ðr\   c                ó.   — | j                   j                  S )z¦AMQP Management API.

        Experimental manager that can be used to manage/monitor the broker
        instance.

        Not available for all transports.
        )r6   Úmanagerrf   s    rZ   rT  zConnection.managerÑ  s   € ð �~‰~×%Ñ%Ð%r\   c                ó:   —  | j                   j                  |i |¤ŽS rq   )r6   Úget_managerr²   s      rZ   rV  zConnection.get_managerÜ  s   € Ø)ˆt�~‰~×)Ñ)¨4Ð:°6Ñ:Ð:r\   c                óˆ   — 	 | j                  «       j                  S # t        $ r | j                  | j                  z   cY S w xY w)z¼Recoverable connection errors.

        List of connection related exceptions that can be recovered from,
        but where the connection must be closed and re-established first.
        )r   rÃ   rš   r’   r“   rf   s    rZ   rÃ   z(Connection.recoverable_connection_errorsß  sG   € ð	@Ø×)Ñ)Ó+×IÑIÐIøÜò 	@ð
 ×)Ñ)¨D×,?Ñ,?Ñ?Ò?ð	@ús   ‚ œ"AÁ Ac                óV   — 	 | j                  «       j                  S # t        $ r Y yw xY w)z©Recoverable channel errors.

        List of channel related exceptions that can be automatically
        recovered from without re-establishing the connection.
        r>   )r   rÊ   rš   rf   s    rZ   rÊ   z%Connection.recoverable_channel_errorsï  s.   € ð	Ø×)Ñ)Ó+×FÑFÐFøÜò 	Ùð	ús   ‚ œ	(§(c                ó6   — | j                  «       j                  S )z8List of exceptions that may be raised by the connection.)r   r’   rf   s    rZ   r’   zConnection.connection_errorsû  s   € ð ×%Ñ%Ó'×9Ñ9Ð9r\   c                ó6   — | j                  «       j                  S )z5List of exceptions that may be raised by the channel.)r   r“   rf   s    rZ   r“   zConnection.channel_errors   s   € ð ×%Ñ%Ó'×6Ñ6Ð6r\   c                óB   — | j                   j                  j                  S rq   )r6   r/  Ú
heartbeatsrf   s    rZ   Úsupports_heartbeatszConnection.supports_heartbeats  s   € à�~‰~×(Ñ(×3Ñ3Ð3r\   c                óB   — | j                   j                  j                  S rq   )r6   r/  Úasynchronousrf   s    rZ   Ú
is_eventedzConnection.is_evented	  s   € à�~‰~×(Ñ(×5Ñ5Ð5r\   )r  NNNNFFNr-   NNNr   r'   NN)é   rq   )NNra  ra  é   NTN)NNr   r   r   NN)T)ÚreturnrA   )NN)NNNNN)r>  ztype[BaseException] | Noner?  zBaseException | Noner@  zTracebackType | Nonerc  ÚNone)rc  r   )]rä   ræ   rð   rå   r3   r2   r7   r`   r˜   r—   r£   rR   rF   rT   r   rP   rN   r9   r  rL   r/   r0   r1   r5   r8   r[   rd   rg   rI   rr   r|   rƒ   rŠ   r�   r�   r•   r�   r¡   r    r­   r°   r^   r³   r‚   r   r   ÚOperationalErrorrÀ   rÁ   r·   rÒ   rç   rô   rö   r   rý   rÿ   rü   r  r	  r   r  r  r#   r  r  r!  r)  r-  r1  r4  r6  r9  r;  rA  ÚpropertyrC  rH  r¿   rs   rÂ   rØ   rQ  r6   r   rT  rV  rÃ   rÊ   r’   r“   r]  r`  r>   r\   rZ   r!   r!   ?   sS  „ ñCðJ €DØ€LØ€Oà€GØ€KØÐØ€JØ€GØ€Jð Ðð €Eð Ðð
 &Ðð €Ià%€OØ-Ðà8<Ð<€HÐ<ˆvÐ<˜Ð< 3¨à48ØEJØ<=ØGKØ0=Ø6:óC'òJGò&*ò
7ò2Gò*ò
òóJò(Fòò
$òò#ó
 ò,ð €Eòð )-Ø8:Ø15Øó	7ðr ð '×7Ñ7Ø#×4Ñ4ò2ó ð2ð ñó ðòGò)ð :>Ø?@Ø,0óhóT*=òX5òòKòFó$òL"ò7ð
 ',°$Ù# F¨H°jØ$2°KóAð
àEHó
ó>5ó:2ó::ó
Bð
 9=Ø#Ø04ó4ð@ :>Ø $Ø15ó5ò(òHòAòòAòðà,ðð &ðð %ð	ð
 
óð ñJó ðJòð* ñDó ðDð ñ$ó ð$ò ð ò%ó ð%ð( ñ9ó ð9ð ñó ðð
 ñ&ó ð&ò;ð ñ@ó ð@ð ñ	ó ð	ð ñ:ó ð:ð ñ7ó ð7ð ñ4ó ð4ð ñ6ó ñ6r\   r!   c                  ó2   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ fd„Zˆ xZS )ÚPooledConnectionz»Wraps :class:`kombu.Connection`.

    This wrapper modifies :meth:`kombu.Connection.__exit__` to close the connection
    in case any exception occurred while the context was active.
    c                ó2   •— || _         t        ‰| �  di |¤Ž y )Nr>   )Ú_poolÚsuperr[   )rU   ÚpoolrW   rû   s      €rZ   r[   zPooledConnection.__init__  s   ø€ ØˆŒ
Ü‰ÑÑ"˜6Ó"r\   c                ó   — | S rq   r>   rf   s    rZ   r;  zPooledConnection.__enter__  r<  r\   c                óŒ   •— |�1| j                   j                  r| j                   j                  | «       t        ‰| �  |||«      S rq   )rj  r  Úreplacerk  rA  )rU   r>  r?  r@  rû   s       €rZ   rA  zPooledConnection.__exit__  s;   ø€ ØÐ D§J¡J×$4Ò$4Ø�J‰J×Ñ˜tÔ$Ü‰wÑ ¨'°6Ó:Ð:r\   )rä   ræ   rð   rå   r[   r;  rA  Ú__classcell__©rû   s   @rZ   rh  rh    s   ø„ ñô#ò÷;ð ;r\   rh  c                  óx   ‡ — e Zd ZdZej
                  ZdZdˆ fd„	Zd„ Z	d„ Z
d„ Zdd„Zedd„«       Zd	„ Zd
„ Zˆ xZS )r"   zPool of connections.Tc                ó4   •— || _         t        ‰| �	  |¬«       y ©N)r  ©rs   rk  r[   ©rU   rs   r  rW   rû   s       €rZ   r[   zConnectionPool.__init__+  ó   ø€ Ø$ˆŒÜ‰Ñ˜uÐÕ%r\   c           	     ó`   — t        | fi t        | j                  j                  d¬«      «      ¤ŽS )NFrù   )rh  ra   rs   rü   rf   s    rZ   ÚnewzConnectionPool.new/  s)   € Ü ÑS¬¨T¯_©_×-BÑ-BÈ5Ð-BÓ-QÓ(RÑSÐSr\   c                óF   — 	 |j                  d«       y # t        $ r Y y w xY w)NÚreleased)r|   rš   ©rU   Úresources     rZ   Úrelease_resourcezConnectionPool.release_resource2  s%   € ð	Ø�O‰O˜JÕ'øÜò 	Ùð	ús   ‚ ”	 Ÿ c                ó$   — |j                  «        y rq   r¯   r|  s     rZ   Úclose_resourcezConnectionPool.close_resource8  s   € Ø�‰Õr\   c                óF   — t        |t        «      s|j                  |«      S y rq   )r@   r   r­   )rU   r}  rª   s      rZ   Úcollect_resourcezConnectionPool.collect_resource;  s"   € Ü˜(¤DÔ)Ø×#Ñ# NÓ3Ð3ð *r\   c              #  óz   K  — | j                  |¬«      5 }||j                  f–— d d d «       y # 1 sw Y   y xY w­w)N)Úblock)ÚacquirerØ   )rU   r„  rs   s      rZ   Úacquire_channelzConnectionPool.acquire_channel?  s2   è ø€ à�\‰\ ˆ\Ô&¨*Ø˜j×8Ñ8Ð8Ò8÷ '×&Ñ&üs   ‚;•/¦	;¯8´;c                ób  — | j                   r£| j                  j                  }t        |«      | j                   t        | j                  «      z
  k  r^| j                  j                  t        | j                  «      «       t        |«      | j                   t        | j                  «      z
  k  rŒ]y y y rq   )r  Ú	_resourceÚqueuerÏ   Ú_dirtyÚ
put_nowaitr   ry  )rU   Úqs     rZ   ÚsetupzConnectionPool.setupD  su   € Ø�:Š:Ø—‘×$Ñ$ˆAä�a“&˜4Ÿ:™:¬¨D¯K©KÓ(8Ñ8Ò8Ø—‘×)Ñ)¬$¨t¯x©x«.Ô9ô �a“&˜4Ÿ:™:¬¨D¯K©KÓ(8Ñ8Õ8ð r\   c                óL   — t        |«      r |«       }|j                  d«       |S )NÚacquired)Úcallabler|   r|  s     rZ   ÚpreparezConnectionPool.prepareK  s"   € Ü�HÔÙ“zˆHØ�‰˜
Ô#Øˆr\   rq   )gš™™™™™¹?)F)rä   ræ   rð   rå   r   ÚConnectionLimitExceededÚLimitExceededÚclose_after_forkr[   ry  r~  r€  r‚  r   r†  r�  r‘  rp  rq  s   @rZ   r"   r"   %  sO   ø„ Ùà×6Ñ6€MØÐõ&òTòòó4ð ò9ó ð9ò:ör\   r"   c                  óN   ‡ — e Zd ZdZej
                  Zdˆ fd„	Zd„ Zd„ Z	d„ Z
ˆ xZS )r#   zPool of channels.c                ó4   •— || _         t        ‰| �	  |¬«       y rt  ru  rv  s       €rZ   r[   zChannelPool.__init__W  rw  r\   c                ó@   — t        | j                  j                  «      S rq   )r   rs   rŠ   rf   s    rZ   ry  zChannelPool.new[  s   € Ü�D—O‘O×+Ñ+Ó,Ð,r\   c                ón  — | j                  «       }| j                  r™| j                  j                  }t	        |«      | j                  t	        | j
                  «      z
  k  rT| j                  j                  t        |«      «       t	        |«      | j                  t	        | j
                  «      z
  k  rŒSy y y rq   )ry  r  rˆ  r‰  rÏ   rŠ  r‹  r   )rU   rŠ   rŒ  s      rZ   r�  zChannelPool.setup^  s|   € Ø—(‘(“*ˆØ�:Š:Ø—‘×$Ñ$ˆAä�a“&˜4Ÿ:™:¬¨D¯K©KÓ(8Ñ8Ò8Ø—‘×)Ñ)¬$¨w«-Ô8ô �a“&˜4Ÿ:™:¬¨D¯K©KÓ(8Ñ8Õ8ð r\   c                ó*   — t        |«      r |«       }|S rq   )r�  r”   s     rZ   r‘  zChannelPool.preparef  s   € Ü�GÔÙ“iˆGØˆr\   rq   )rä   ræ   rð   rå   r   ÚChannelLimitExceededr“  r[   ry  r�  r‘  rp  rq  s   @rZ   r#   r#   R  s%   ø„ Ùà×3Ñ3€Mõ&ò-ò9ör\   r#   c                ó4   — t        | «      r| j                  S | S )z�Get channel from object.

    Return the default channel if argument is a connection instance,
    otherwise just return the channel given.
    )Úis_connectionrØ   )rŠ   s    rZ   Úmaybe_channelr�  l  s   € ô �WÔØ×&Ñ&Ð&Ø€Nr\   c                ó"   — t        | t        «      S rq   )r@   r!   )rß   s    rZ   rœ  rœ  w  s   € Ü�cœ:Ó&Ð&r\   )rŠ   zChannel | Connectionrc  r   )rß   r	   rc  zTypeGuard[Connection])Drå   Ú
__future__r   Úosr›   ÚsysÚ
contextlibr   Ú	itertoolsr   r   Úoperatorr   Útypingr   r	   r5   r
   rk   ÚImportErrorÚkombur   Úlogr   r}  r   r6   r   r   Úutils.collectionsr   Úutils.functionalr   r   r   r   Úutils.objectsr   Ú	utils.urlr   r   r   r   r   Úkombu.transport.virtualr   Úversion_infoÚtyping_extensionsr   Útypesr    Ú__all__rä   rl   Úroundrobin_failoverr  rL   ÚenvironrM   rQ   r‡   r!   ÚBrokerConnectionrh  r"   r#   r�  rœ  r>   r\   rZ   Ú<module>rµ     s*  ðÙ å "ã 	Û Û 
Ý %ß "Ý ß %ðÝØ€Mõ å Ý ß >Ý (ß MÓ MÝ *ß MÕ MáÝ/à
×Ñ˜'Ò!Þ/å$å#à
9€á	�HÓ	€àÐ ð Øñ€ð 'ØñÐ ð
 —*‘*—.‘.Ð!7¸Ó?€Ø�z‰z�~‰~Ð1°5Ó9€÷L6ñ L6ð^ Ð ô;�zô ;ô(*�Xô *ôZ�(ô ó4ô'øðO# ò Ø€IØ‚Mðús   ²D( Ä(	D4Ä3D4