HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/kombu/transport/virtual/__pycache__/exchange.cpython-39.pyc
a

X>h�@srdZddlmZddlZddlmZGdd�d�ZGdd�de�ZGd	d
�d
e�ZGdd�de�Z	eee	d
�Z
dS)z�Virtual AMQ Exchange.

Implementations of the standard exchanges defined
by the AMQ protocol  (excluding the `headers` exchange).
�)�annotationsN)�escape_regexc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�ExchangeTypez�Base class for exchanges.

    Implements the specifics for an exchange type.

    Arguments:
    ---------
        channel (ChannelT): AMQ Channel.
    NcCs
||_dS�N)�channel)�selfr�r�J/usr/local/lib/python3.9/site-packages/kombu/transport/virtual/exchange.py�__init__szExchangeType.__init__cCstd��dS)z�Lookup all queues matching `routing_key` in `exchange`.

        Returns
        -------
            str: queue name, or 'default' if no queues matched.
        zsubclass responsibilityN)�NotImplementedError�r�table�exchange�routing_key�defaultrrr	�lookupszExchangeType.lookupcCs
|d|fS)z�Prepare queue-binding.

        Returns
        -------
            Tuple[str, Pattern, str]: of `(routing_key, regex, queue)`
                to be stored for bindings to this exchange.
        Nr�r�queuerr�	argumentsrrr	�prepare_bind&szExchangeType.prepare_bindcCs8||dko6||dko6||dko6|p*i|dp4ikS)z3Return true if `prev` and `exchange` is equivalent.�type�durable�auto_deleterr)r�prevrrrrrrrr	�
equivalent0s
�
��zExchangeType.equivalent)	�__name__�
__module__�__qualname__�__doc__rr
rrrrrrr	rs		
rc@s$eZdZdZdZdd�Zdd�ZdS)�DirectExchangezTDirect exchange.

    The `direct` exchange routes based on exact routing keys.
    �directcs�fdd�|D�S)Ncsh|]\}}}|�kr|�qSrr)�.0�rkey�_r�rrr	�	<setcomp>Bs�z(DirectExchange.lookup.<locals>.<setcomp>rrrr$r	rAs
�zDirectExchange.lookupcKs6|jj}|jj}|||�D]}|||fi|��qdSr)r�_lookup�_put�r�messagerr�kwargsr&r'rrrr	�deliverGszDirectExchange.deliverN�rrrrrrr+rrrr	r9src@sJeZdZdZdZddd�ZiZdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
TopicExchangez�Topic exchange.

    The `topic` exchange routes messages based on words separated by
    dots, using wildcard characters ``*`` (any single word), and ``#``
    (one or more words).
    �topicz.*?[^\.]z.*?)�*�#cs��fdd�|D�S)Ncs"h|]\}}}��|��r|�qSr)�_match)r!r"�patternr�rrrr	r%`s�z'TopicExchange.lookup.<locals>.<setcomp>rrrr3r	r_s�zTopicExchange.lookupcsL|jj}|jj}|jj��fdd�|||�D�D]}|||fi|��q0dS)Ncsg|]}|r|�kr|�qSrr)r!�q�Z
deadletterrr	�
<listcomp>is�z)TopicExchange.deliver.<locals>.<listcomp>)rr&r'Zdeadletter_queuer(rr5r	r+es
zTopicExchange.delivercCs||�|�|fSr)�key_to_patternrrrr	rmszTopicExchange.prepare_bindcs(dd��fdd�t|d��d�D��S)z0Get the corresponding regex for any routing key.z^%s$z\.c3s|]}�j�||�VqdSr)�	wildcards�get)r!�word�rrr	�	<genexpr>rs�z/TopicExchange.key_to_pattern.<locals>.<genexpr>z.#*�.)�joinr�split)rr"rr;r	r7ps�zTopicExchange.key_to_patterncCsDz|j|}Wn*ty8t�|tj�}|j|<Yn0|�|�S)z�Match regular expression (cached).

        Same as :func:`re.match`, except the regex is compiled and cached,
        then reused on subsequent matches with the same pattern.
        )�	_compiled�KeyError�re�compile�U�match)rr2�stringZcompiledrrr	r1ws
zTopicExchange._matchN)rrrrrr8r@rr+rr7r1rrrr	r-Ns�r-c@s$eZdZdZdZdd�Zdd�ZdS)�FanoutExchangea�Fanout exchange.

    The `fanout` exchange implements broadcast messaging by delivering
    copies of all messages to all queues bound to the exchange.

    To support fanout the virtual channel needs to store the table
    as shared state.  This requires that the `Channel.supports_fanout`
    attribute is set to true, and the `Channel._queue_bind` and
    `Channel.get_table` methods are implemented.

    See Also
    --------
        the redis backend for an example implementation of these methods.
    �fanoutcCsdd�|D�S)NcSsh|]\}}}|�qSrr)r!r#rrrr	r%��z(FanoutExchange.lookup.<locals>.<setcomp>rrrrr	r�szFanoutExchange.lookupcKs$|jjr |jj|||fi|��dSr)rZsupports_fanoutZ_put_fanout)rr)rrr*rrr	r+�s��zFanoutExchange.deliverNr,rrrr	rG�srG)r r.rH)r�
__future__rrBZkombu.utils.textrrrr-rGZSTANDARD_EXCHANGE_TYPESrrrr	�<module>s+6�