
    ^f                        d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	m
Z
 dZdZeed	Zd
ZdZd Zd ZdefdZ G d de          Z G d de          Z G d de          ZdS )z Exchange and Queue declarations.    )annotationsN   )MaybeChannelBoundObject)ContentDisallowed)prepare_accept_content   )	transient
persistent)ExchangeQueuebindingmaybe_delivery_mode)zamq.c                    t          |           } t          | t                    r|                     d          r
| dd         S | dd         S )Nzu'r	   r   )repr
isinstancestr
startswith)ss    >/var/www/html/env/lib/python3.11/site-packages/kombu/entity.py_reprstrr      sL    QA!S all400 2wQrT7N    c                x    d                     d                    t          t          |                               S )Nz[{}]z, )formatjoinmapr   )bindingss    r   pretty_bindingsr      s*    ==3sH#5#566777r   c                h    |st           n|}| r$t          | t          j                  r| n||          S |S )z1Get delivery mode by name (or none if undefined).)DELIVERY_MODESr   numbersIntegral)vmodesdefaults      r   r   r       s@     #(2NNUE Bq'"233AqqqANr   c            	           e Zd ZdZeZeZdZdZdZdZ	dZ
dZdZddd	d
efdefdefdd fdeffZd fd	Zd Zd Zd dZ	 	 d!dZ	 	 d"dZd#dZ	 	 d$dZd%dZd&dZd Zd Zd Zd Zed             Z xZS )'r   a  An Exchange declaration.

    Arguments:
    ---------
        name (str): See :attr:`name`.
        type (str): See :attr:`type`.
        channel (kombu.Connection, ChannelT): See :attr:`channel`.
        durable (bool): See :attr:`durable`.
        auto_delete (bool): See :attr:`auto_delete`.
        delivery_mode (enum): See :attr:`delivery_mode`.
        arguments (Dict): See :attr:`arguments`.
        no_declare (bool): See :attr:`no_declare`

    Attributes
    ----------
        name (str): Name of the exchange.
            Default is no name (the default exchange).

        type (str):
            *This description of AMQP exchange types was shamelessly stolen
            from the blog post `AMQP in 10 minutes: Part 4`_ by
            Rajith Attapattu. Reading this article is recommended if you're
            new to amqp.*

            "AMQP defines four default exchange types (routing algorithms) that
            covers most of the common messaging use cases. An AMQP broker can
            also define additional exchange types, so see your broker
            manual for more information about available exchange types.

                * `direct` (*default*)

                    Direct match between the routing key in the message,
                    and the routing criteria used when a queue is bound to
                    this exchange.

                * `topic`

                    Wildcard match between the routing key and the routing
                    pattern specified in the exchange/queue binding.
                    The routing key is treated as zero or more words delimited
                    by `"."` and supports special wildcard characters. `"*"`
                    matches a single word and `"#"` matches zero or more words.

                * `fanout`

                    Queues are bound to this exchange with no arguments. Hence
                    any message sent to this exchange will be forwarded to all
                    queues bound to this exchange.

                * `headers`

                    Queues are bound to this exchange with a table of arguments
                    containing headers and values (optional). A special
                    argument named "x-match" determines the matching algorithm,
                    where `"all"` implies an `AND` (all pairs must match) and
                    `"any"` implies `OR` (at least one pair must match).

                    :attr:`arguments` is used to specify the arguments.


                .. _`AMQP in 10 minutes: Part 4`:
                    https://bit.ly/2rcICv5

        channel (ChannelT): The channel the exchange is bound to (if bound).

        durable (bool): Durable exchanges remain active when a server restarts.
            Non-durable exchanges (transient exchanges) are purged when a
            server restarts.  Default is :const:`True`.

        auto_delete (bool): If set, the exchange is deleted when all queues
            have finished using it. Default is :const:`False`.

        delivery_mode (enum): The default delivery mode used for messages.
            The value is an integer, or alias string.

                * 1 or `"transient"`

                    The message is transient. Which means it is stored in
                    memory only, and is lost if the server dies or restarts.

                * 2 or "persistent" (*default*)
                    The message is persistent. Which means the message is
                    stored both in-memory, and on disk, and therefore
                    preserved if the server dies or restarts.

            The default value is 2 (persistent).

        arguments (Dict): Additional arguments to specify when the exchange
            is declared.

        no_declare (bool): Never declare this exchange
            (:meth:`declare` does nothing).
     directTFNnameN)typeN	argumentsNdurablepassiveauto_deletedelivery_modec                :    t                               |           p| S N)r!   get)ms    r   <lambda>zExchange.<lambda>   s    N$6$6q$9$9$>Q r   
no_declarec                     t                      j        di | |p| j        | _        |p| j        | _        |                     |           d S )N )super__init__r+   r,   
maybe_bind)selfr+   r,   channelkwargs	__class__s        r   r<   zExchange.__init__   sT    ""6"""%DI	%DI	     r   c                0    t          d| j                   S )NzE|hashr+   r>   s    r   __hash__zExchange.__hash__       $$$%%%r   c                `    | j          o&| j        o| j                            t                     S r4   )r8   r+   r   INTERNAL_EXCHANGE_PREFIXrE   s    r   _can_declarezExchange._can_declare   s:    ?" +I *di22(* * *	+r   c           	         |                                  rG|| j        n|}|p| j                            | j        | j        | j        | j        | j        ||          S dS )aI  Declare the exchange.

        Creates the exchange on the broker, unless passive is set
        in which case it will only assert that the exchange exists.

        Argument:
            nowait (bool): If set the server will not respond, and a
                response will not be waited for. Default is :const:`False`.
        N)exchanger,   r/   r1   r.   nowaitr0   )	rJ   r0   r?   exchange_declarer+   r,   r/   r1   r.   )r>   rM   r0   r?   s       r   declarezExchange.declare   sq      	&-odll7G+t|==DL ,w >   	 	r   c                    t          |t                    r|j        }|p| j                            | j        ||||          S )a  Bind the exchange to another exchange.

        Arguments:
        ---------
            nowait (bool): If set the server will not respond, and the call
                will not block waiting for a response.
                Default is :const:`False`.
        destinationsourcerouting_keyrM   r.   )r   r   r+   r?   exchange_bind)r>   rL   rT   r.   rM   r?   r@   s          r   bind_tozExchange.bind_to   sR     h)) 	%}H'4<66	# 7 
 
 	
r   c                    t          |t                    r|j        }|p| j                            | j        ||||          S )z;Delete previously created exchange binding from the server.rQ   )r   r   r+   r?   exchange_unbind)r>   rS   rT   rM   r.   r?   s         r   unbind_fromzExchange.unbind_from   sR     fh'' 	![F'4<88	# 9 
 
 	
r   c                    |i n|}t          | j                  |d<   t          |t                    o|                    dd          	 d|d<    | j        j        |fd|i|S )aI  Create message instance to be sent with :meth:`publish`.

        Arguments:
        ---------
            body (Any): Message body.

            delivery_mode (bool): Set custom delivery mode.
                Defaults to :attr:`delivery_mode`.

            priority (int): Message priority, 0 to broker configured
                max priority, where higher is better.

            content_type (str): The messages content_type.  If content_type
                is set, no serialization occurs as it is assumed this is either
                a binary object, or you've done your own serialization.
                Leave blank if using built-in serialization as our library
                properly sets content_type.

            content_encoding (str): The character set in which this object
                is encoded. Use "binary" if sending in raw binary objects.
                Leave blank if using built-in serialization as our library
                properly sets content_encoding.

            properties (Dict): Message properties.

            headers (Dict): Message headers.
        Nr2   content_encodingzutf-8
properties)r   r2   r   r   r5   r?   prepare_message)r>   bodyr2   r\   r@   s        r   MessagezExchange.Message   s    8 &-RR:
&9$:L&M&M
?#tS!! 91488TB)0F%&+t|+ !   	r   c                    t          |t                    r|                     |          }|p| j        }| j                            |||||          S )a=  Publish message.

        Arguments:
        ---------
            message (Union[kombu.Message, str, bytes]):
                Message to publish.
            routing_key (str): Message routing key.
            mandatory (bool): Currently not supported.
            immediate (bool): Currently not supported.
        )rL   rT   	mandatory	immediate)r   r   r_   r+   r?   basic_publish)r>   messagerT   ra   rb   rL   s         r   publishzExchange.publish  sa     gs## 	,ll7++G(ty|))# * 
 
 	
r   c                F    | j                             | j        ||          S )a`  Delete the exchange declaration on server.

        Arguments:
        ---------
            if_unused (bool): Delete only if the exchange has no bindings.
                Default is :const:`False`.
            nowait (bool): If set the server will not respond, and a
                response will not be waited for. Default is :const:`False`.
        )rL   	if_unusedrM   )r?   exchange_deleter+   )r>   rg   rM   s      r   deletezExchange.delete  s-     |++TY6?39 , ; ; 	;r   c                &    t          | |||          S r4   )r   )r>   rT   r.   unbind_argumentss       r   r   zExchange.binding*  s    t[)5EFFFr   c                    t          |t                    r`| j        |j        k    oO| j        |j        k    o?| j        |j        k    o/| j        |j        k    o| j        |j        k    o| j        |j        k    S t          S r4   )	r   r   r+   r,   r.   r/   r1   r2   NotImplementedr>   others     r   __eq__zExchange.__eq__-  s    eX&& 	?I+ >I+>Neo5> LEM1> $(99	>
 &%*==? r   c                .    |                      |           S r4   rp   rn   s     r   __ne__zExchange.__ne__7      ;;u%%%%r   c                ,    |                      |           S r4   )_repr_entityrE   s    r   __repr__zExchange.__repr__:  s      &&&r   c                z    d                     t          | j                  pt          d          | j                  S )NzExchange {}({})r(   )r   r   r+   r   r,   rE   s    r   __str__zExchange.__str__=  s6     ''TY+488TY
 
 	
r   c                    | j          S r4   )r1   rE   s    r   can_cache_declarationzExchange.can_cache_declarationB  s    ###r   )r(   r(   N)FNNr(   r(   NFN)r(   r(   FNNNN)NFFN)FF)r(   NN) __name__
__module____qualname____doc__TRANSIENT_DELIVERY_MODEPERSISTENT_DELIVERY_MODEr+   r,   r/   r1   r0   r2   r8   boolattrsr<   rF   rJ   rO   rV   rY   r_   re   ri   r   rp   rs   rw   ry   propertyr{   __classcell__rA   s   @r   r   r   )   s       \ \| 67DDGKGMJ 		D	D		>>?	t	E! ! ! ! ! !& & &+ + +
   $ 026:
 
 
 
( 24:>
 
 
 
$ $ $ $L <A*.
 
 
 
.; ; ; ;G G G G  & & &' ' '
 
 

 $ $ X$ $ $ $ $r   r   c                  F    e Zd ZdZdZ	 	 ddZddZddZdd	Zd
 Z	d Z
dS )r   a1  Represents a queue or exchange binding.

    Arguments:
    ---------
        exchange (Exchange): Exchange to bind to.
        routing_key (str): Routing key used as binding key.
        arguments (Dict): Arguments for bind operation.
        unbind_arguments (Dict): Arguments for unbind operation.
    )rL   NrT   Nr-   )rk   NNr(   c                >    || _         || _        || _        || _        d S r4   )rL   rT   r.   rk   )r>   rL   rT   r.   rk   s        r   r<   zbinding.__init__Y  s&     &" 0r   Fc                l    | j         r*| j         j        r | j                             ||           dS dS dS )zDeclare destination exchange.r?   rM   N)rL   r+   rO   )r>   r?   rM   s      r   rO   zbinding.declare`  sS    = 	BT]/ 	BM!!'&!AAAAA	B 	B 	B 	Br   c                X    |                     | j        | j        | j        ||           dS )zBind entity to this binding.)rL   rT   r.   rM   r?   N)rV   rL   rT   r.   r>   entityrM   r?   s       r   bindzbinding.binde  s<    #'#3!%$&	 	 	( 	( 	( 	( 	(r   c                X    |                     | j        | j        | j        ||           dS )z Unbind entity from this binding.)rT   r.   rM   r?   N)rY   rL   rT   rk   r   s       r   unbindzbinding.unbindm  s?    4='+'7%)%:"(#*	 	 	, 	, 	, 	, 	,r   c                    d|  dS )Nz
<binding: >r:   rE   s    r   rw   zbinding.__repr__u  s    #D####r   c                    d                     t          | j        j                  t          | j                            S )Nz{}->{})r   r   rL   r+   rT   rE   s    r   ry   zbinding.__str__x  s5    T]'(((43C*D*D
 
 	
r   )Nr(   NNFFN)r~   r   r   r   r   r<   rO   r   r   rw   ry   r:   r   r   r   r   G  s         E 35261 1 1 1B B B B
( ( ( (, , , ,$ $ $
 
 
 
 
r   r   c                      e Zd ZdZeZdZ ed          ZdZdZ	dZ
dZdZddddd	d
defdefdefdddefdefdefdefdefdefdeffZ	 	 d0 fd	Z fdZd Zd Zd1dZd1dZd1dZd1dZd2d Zd1d!Z	 	 d3d"Zd4d#Zd5d$Z	 	 d6d%Zd& Z d7d'Z!d8d(Z"	 	 d3d)Z#d* Z$d+ Z%d, Z&e'd-             Z(e)d.             Z*d5 fd/	Z+ xZ,S )9r   a  A Queue declaration.

    Arguments:
    ---------
        name (str): See :attr:`name`.
        exchange (Exchange, str): See :attr:`exchange`.
        routing_key (str): See :attr:`routing_key`.
        channel (kombu.Connection, ChannelT): See :attr:`channel`.
        durable (bool): See :attr:`durable`.
        exclusive (bool): See :attr:`exclusive`.
        auto_delete (bool): See :attr:`auto_delete`.
        queue_arguments (Dict): See :attr:`queue_arguments`.
        binding_arguments (Dict): See :attr:`binding_arguments`.
        consumer_arguments (Dict): See :attr:`consumer_arguments`.
        no_declare (bool): See :attr:`no_declare`.
        on_declared (Callable): See :attr:`on_declared`.
        expires (float): See :attr:`expires`.
        message_ttl (float): See :attr:`message_ttl`.
        max_length (int): See :attr:`max_length`.
        max_length_bytes (int): See :attr:`max_length_bytes`.
        max_priority (int): See :attr:`max_priority`.

    Attributes
    ----------
        name (str): Name of the queue.
            Default is no name (default queue destination).

        exchange (Exchange): The :class:`Exchange` the queue binds to.

        routing_key (str): The routing key (if any), also called *binding key*.

            The interpretation of the routing key depends on
            the :attr:`Exchange.type`.

            * direct exchange

                Matches if the routing key property of the message and
                the :attr:`routing_key` attribute are identical.

            * fanout exchange

                Always matches, even if the binding does not have a key.

            * topic exchange

                Matches the routing key property of the message by a primitive
                pattern matching scheme. The message routing key then consists
                of words separated by dots (`"."`, like domain names), and
                two special characters are available; star (`"*"`) and hash
                (`"#"`). The star matches any word, and the hash matches
                zero or more words. For example `"*.stock.#"` matches the
                routing keys `"usd.stock"` and `"eur.stock.db"` but not
                `"stock.nasdaq"`.

        channel (ChannelT): The channel the Queue is bound to (if bound).

        durable (bool): Durable queues remain active when a server restarts.
            Non-durable queues (transient queues) are purged if/when
            a server restarts.
            Note that durable queues do not necessarily hold persistent
            messages, although it does not make sense to send
            persistent messages to a transient queue.

            Default is :const:`True`.

        exclusive (bool): Exclusive queues may only be consumed from by the
            current connection. Setting the 'exclusive' flag
            always implies 'auto-delete'.

            Default is :const:`False`.

        auto_delete (bool): If set, the queue is deleted when all consumers
            have finished using it. Last consumer can be canceled
            either explicitly or because its channel is closed. If
            there was no consumer ever on the queue, it won't be
            deleted.

        expires (float): Set the expiry time (in seconds) for when this
            queue should expire.

            The expiry time decides how long the queue can stay unused
            before it's automatically deleted.
            *Unused* means the queue has no consumers, the queue has not been
            redeclared, and ``Queue.get`` has not been invoked for a duration
            of at least the expiration period.

            See https://www.rabbitmq.com/ttl.html#queue-ttl

            **RabbitMQ extension**: Only available when using RabbitMQ.

        message_ttl (float): Message time to live in seconds.

            This setting controls how long messages can stay in the queue
            unconsumed. If the expiry time passes before a message consumer
            has received the message, the message is deleted and no consumer
            will see the message.

            See https://www.rabbitmq.com/ttl.html#per-queue-message-ttl

            **RabbitMQ extension**: Only available when using RabbitMQ.

        max_length (int): Set the maximum number of messages that the
            queue can hold.

            If the number of messages in the queue size exceeds this limit,
            new messages will be dropped (or dead-lettered if a dead letter
            exchange is active).

            See https://www.rabbitmq.com/maxlength.html

            **RabbitMQ extension**: Only available when using RabbitMQ.

        max_length_bytes (int): Set the max size (in bytes) for the total
            of messages in the queue.

            If the total size of all the messages in the queue exceeds this
            limit, new messages will be dropped (or dead-lettered if a dead
            letter exchange is active).

            **RabbitMQ extension**: Only available when using RabbitMQ.

        max_priority (int): Set the highest priority number for this queue.

            For example if the value is 10, then messages can delivered to
            this queue can have a ``priority`` value between 0 and 10,
            where 10 is the highest priority.

            RabbitMQ queues without a max priority set will ignore
            the priority field in the message, so if you want priorities
            you need to set the max priority field to declare the queue
            as a priority queue.

            **RabbitMQ extension**: Only available when using RabbitMQ.

        queue_arguments (Dict): Additional arguments used when declaring
            the queue.  Can be used to to set the arguments value
            for RabbitMQ/AMQP's ``queue.declare``.

        binding_arguments (Dict): Additional arguments used when binding
            the queue.  Can be used to to set the arguments value
            for RabbitMQ/AMQP's ``queue.declare``.

        consumer_arguments (Dict): Additional arguments used when consuming
            from this queue.  Can be used to to set the arguments value
            for RabbitMQ/AMQP's ``basic.consume``.

        alias (str): Unused in Kombu, but applications can take advantage
            of this,  for example to give alternate names to queues with
            automatically generated queue names.

        on_declared (Callable): Optional callback to be applied when the
            queue has been declared (the ``queue_declare`` operation is
            complete).  This must be a function with a signature that
            accepts at least 3 positional arguments:
            ``(name, messages, consumers)``.

        no_declare (bool): Never declare this queue, nor related
            entities (:meth:`declare` does nothing).
    r(   TFr*   r   r   )queue_argumentsN)binding_argumentsN)consumer_argumentsNr/   	exclusiver1   )no_ackN)aliasNr   r8   expiresmessage_ttl
max_lengthmax_length_bytesmax_priorityNc                    t                      j        di | |p| j        | _        t          |t                    rt          |          | _        nt          |t
                    r|| _        |p| j        | _        t          |pg           | _	        || _
        t          |t          t          t          f          r| xj	        t          |          z  c_	        | j	        rd | _        | j        rd| _        |                     |           d S )NTr:   )r;   r<   r+   r   r   r   rL   rT   setr   on_declaredlisttupler   r1   r=   )	r>   r+   rL   rT   r?   r   r   r@   rA   s	           r   r<   zQueue.__init__?  s    	""6"""%DI	h$$ 	%$X..DMM(++ 	%$DM&:$*:HN++& huc 233 	+MMS]]*MM= 	! DM > 	$#D     r   c                f    | j         }t                                          |          }||_         |S r4   )r   r;   r   )r>   r?   r   boundrA   s       r   r   z
Queue.bindW  s-    &W%%'r   c                0    t          d| j                   S )NzQ|rC   rE   s    r   rF   zQueue.__hash__]  rG   r   c                V    | j         r!|                      | j                  | _         d S d S r4   )rL   r?   rE   s    r   
when_boundzQueue.when_bound`  s/    = 	8 MM$,77DMMM	8 	8r   c                    | j         sE|                     ||           |                     ||           |                     ||           | j        S )z8Declare queue and exchange then binds queue to exchange.rM   r?   )r8   _create_exchange_create_queue_create_bindingsr+   r>   rM   r?   s      r   rO   zQueue.declared  s`     	B!!!AAAfg>>>!!!AAAyr   c                P    | j         r| j                             ||           d S d S Nr   )rL   rO   r   s      r   r   zQueue._create_exchangem  s:    = 	BM!!!AAAAA	B 	Br   c                    |                      |d|           | j        r%| j        j        r|                     ||           d S d S d S )NF)rM   r0   r?   r   )queue_declarerL   r+   
queue_bindr   s      r   r   zQueue._create_queueq  sc    &%III= 	<T]/ 	<OO67O;;;;;	< 	< 	< 	<r   c                    | j         D ]8}|p| j        }|                    |           |                    | ||           9d S r   )r   r?   rO   r   )r>   rM   r?   Bs       r   r   zQueue._create_bindingsv  sV     	9 	9A-GIIgFF4F8888	9 	9r   c           	     8   |p| j         }|                    | j        pi | j        | j        | j        | j        | j                  }|                    | j	        || j
        | j        | j        ||          }| j	        s|d         | _	        | j        r
 | j        |  |S )aE  Declare queue on the server.

        Arguments:
        ---------
            nowait (bool): Do not wait for a reply.
            passive (bool): If set, the server will not create the queue.
                The client can use this to check whether a queue exists
                without modifying the server state.
        )r   r   r   r   r   )queuer0   r/   r   r1   r.   rM   r   )r?   prepare_queue_argumentsr   r   r   r   r   r   r   r+   r/   r   r1   r   )r>   rM   r0   r?   r   rets         r   r   zQueue.queue_declare|  s     )T\!99 &BL(!2* : 
 
 ##)Ln(% $ 
 
 y 	ADI 	#Dc""
r   c                T    |                      | j        | j        | j        ||          S )z'Create the queue binding on the server.r   )rV   rL   rT   r   r   s      r   r   zQueue.queue_bind  s1    ||DM4+; 2$+F  < < 	<r   c                    t          |t                    r|j        }|p| j                            | j        ||||          S )Nr   rL   rT   r.   rM   )r   r   r+   r?   r   r>   rL   rT   r.   rM   r?   s         r   rV   zQueue.bind_to  sP    h)) 	%}H'4<33)# 4 
 
 	
r   c                   || j         n|}| j                            | j        |          }|Rt	          | j        dd          }|r ||          }|j        r|                                 t          |          |_        |S )ak  Poll the server for a new message.

        This method provides direct access to the messages in a
        queue using a synchronous dialogue, designed for
        specific types of applications where synchronous functionality
        is more important than performance.

        Returns
        -------
            ~kombu.Message: if a message was available,
                or :const:`None` otherwise.

        Arguments:
        ---------
            no_ack (bool): If enabled the broker will
                automatically ack messages.
            accept (Set[str]): Custom list of accepted content types.
        N)r   r   message_to_python)	r   r?   	basic_getr+   getattrerrors_reraise_errorr   accept)r>   r   r   rd   m2ps        r   r5   z	Queue.get  s    & !'F,((ty(HH$,(;TBBC '#g,,~ )&&(((3F;;GNr   c                H    | j                             | j        |          pdS )z)Remove all ready messages from the queue.)r   rM   r   )r?   queue_purger+   )r>   rM   s     r   purgezQueue.purge  s0    |''di/5 ( 7 7 <:;	<r   c           	     n    || j         }| j                            | j        ||pd||| j        |          S )a  Start a queue consumer.

        Consumers last as long as the channel they were created on, or
        until the client cancels them.

        Arguments:
        ---------
            consumer_tag (str): Unique identifier for the consumer.
                The consumer tag is local to a connection, so two clients
                can use the same consumer tags. If this field is empty
                the server will generate a unique tag.

            no_ack (bool): If enabled the broker will automatically
                ack messages.

            nowait (bool): Do not wait for a reply.

            callback (Callable): callback called for each delivered message.

            on_cancel (Callable): callback called on cancel notify received
                from broker.
        Nr(   )r   r   consumer_tagcallbackrM   r.   	on_cancel)r   r?   basic_consumer+   r   )r>   r   r   r   rM   r   s         r   consumezQueue.consume  sN    0 >[F|)))%+- * 
 
 	
r   c                6    | j                             |          S )z"Cancel a consumer by consumer tag.)r?   basic_cancel)r>   r   s     r   cancelzQueue.cancel  s    |((666r   c                H    | j                             | j        |||          S )a  Delete the queue.

        Arguments:
        ---------
            if_unused (bool): If set, the server will only delete the queue
                if it has no consumers. A channel error will be raised
                if the queue has consumers.

            if_empty (bool): If set, the server will only delete the queue if
                it is empty. If it is not empty a channel error will be raised.

            nowait (bool): Do not wait for a reply.
        )r   rg   if_emptyrM   )r?   queue_deleter+   )r>   rg   r   rM   s       r   ri   zQueue.delete  s0     |((ty3<2:06 ) 8 8 	8r   c                H    |                      | j        | j        |||          S r4   )rY   rL   rT   )r>   r.   rM   r?   s       r   queue_unbindzQueue.queue_unbind  s*    t/? )67< < 	<r   c                X    |p| j                             | j        |j        |||          S )z5Unbind queue by deleting the binding from the server.r   )r?   r   r+   r   s         r   rY   zQueue.unbind_from  s;     '4<55)]# 6 
 
 	
r   c                Z   t          |t                    r| j        |j        k    o| j        |j        k    oo| j        |j        k    o_| j        |j        k    oO| j        |j        k    o?| j        |j        k    o/| j        |j        k    o| j	        |j	        k    o| j
        |j
        k    S t          S r4   )r   r   r+   rL   rT   r   r   r   r/   r   r1   rm   rn   s     r   rp   zQueue.__eq__  s    eU## 		;I+ :MU^3:$(99: (E,AA: *e.EE	:
 +u/GG: LEM1: Neo5: $(99; r   c                .    |                      |           S r4   rr   rn   s     r   rs   zQueue.__ne__+  rt   r   c           	     J   | j         rN|                     d                    t          | j                  t          | j                                       S |                     d                    | t          | j                  t          | j                                      S )NzQueue {name} -> {bindings})r+   r   z/Queue {name} -> {0.exchange!r} -> {routing_key})r+   rT   )r   rv   r   r   r+   r   rT   rE   s    r   rw   zQueue.__repr__.  s    = 	$$%A%H%Hdi(((77 &I & &      =DD8DI..$T%566 E  
 
 	
r   c                >    | j         r
d| j         v }nd}| o| j         S )Nz	x-expiresF)r   r1   )r>   expiring_queues     r   r{   zQueue.can_cache_declaration;  s5     	#(D,@@NN"N!!:$*:&::r   c                   |                     d          p|                     d          }|                     d          }||                     d          }|                     d          }||                     d          }|                     d          }||                     d          }|                     d          }||                     d          }|                     d	          }|                     d
          }	|                     d          }
|                     d          }|                     d          }t          |                     d          |                     d          |                     d          |                     d          |||          }t          |||||                     d          ||                     d          |	|
||          S )Nbinding_keyrT   exchange_durabler/   exchange_auto_deleter1   queue_durablequeue_auto_deleteexchange_argumentsr   r   r   r   rL   exchange_typer2   )r,   r2   rT   r/   r1   r.   r   r   )
rL   rT   r/   r   r1   r   r   r   r   r   )r5   r   r   )clsr   optionsr   	e_durablee_auto_delete	q_durableq_auto_deletee_argumentsq_argumentsb_argumentsc_argumentsr   rL   s                 r   	from_dictzQueue.from_dictC  s   kk-00NGKK4N4NKK 233	I..I$:;; #KK66MKK00	I..I$788 #KK66Mkk"677kk"344kk"566kk"677;;z**GKK
33!(_!=!=*1++o*F*F(/M(B(B$-(5&13 3 3 U&!,&&{{;77!.#KK11%0'2(3&
( 
( 
( 
	(r   c                    t                                          |          }|s|S |                    d          }|rd |D             |d<   |S )Nr   c                :    g | ]}|                     d           S )T)recurse)as_dict).0bs     r   
<listcomp>z!Queue.as_dict.<locals>.<listcomp>v  s&    III1qyyy66IIIr   )r;   r   r5   )r>   r   resr   rA   s       r   r   zQueue.as_dictp  s[    ggoog&& 	J77:&& 	JIIIIIC
O
r   )r(   Nr(   NNNr   )FFNr|   r}   r   )r(   NNFN)FFF)NFN)-r~   r   r   r   r   r+   r   rL   rT   r/   r   r1   r   r   r   floatintr   r<   r   rF   r   rO   r   r   r   r   r   rV   r5   r   r   r   ri   r   rY   rp   rs   rw   r   r{   classmethodr   r   r   r   s   @r   r   r   ~  s       ^ ^@ *Dx||HKGIKF 	!#$	D	d		T	t	E		s	S!	%E* <>:>! ! ! ! ! !0    & & &8 8 8   B B B B< < < <
9 9 9 9       D< < < < 026:
 
 
 
   << < < <
 1559"
 "
 "
 "
H7 7 78 8 8 8&< < < < 46:>	
 	
 	
 	
  & & &
 
 
 ; ; X; *( *( [*(X         r   r   )r   
__future__r   r"   abstractr   r   
exceptionsr   serializationr   r   r   r!   __all__rI   r   r   r   r   r   r   r:   r   r   <module>r     sf   & & " " " " " "  / / / / / / / / ) ) ) ) ) ) 1 1 1 1 1 1  6 8: : B$   8 8 8
 7   [$ [$ [$ [$ [$  [$ [$ [$|4
 4
 4
 4
 4
f 4
 4
 4
ny y y y y y y y y yr   