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/__pycache__/pyro.cpython-39.pyc
a

X>h��	@s�dZddlmZddlZddlmZmZddlmZddl	m
Z
ddlmZdd	l
mZz$ddlZdd
lmZddlmZWney�dZZZYn0dZd
ZdZe
e�ZGdd�dej�ZGdd�dej�Zedu�re�ddd��ejejdd�Gdd�d���Z edk�r�e!d�e�"���Z#e!d�$ej%j&ej%j'��e�(��8Z)e!d�$ej%j&��e#�*e �Z+e)�*de+�Wd�n1�s�0Ye#�,�Wd�n1�s�0YdS)a�Pyro transport module for kombu.

Pyro transport, and Kombu Broker daemon.

Requires the :mod:`Pyro4` library to be installed.

Features
========
* Type: Virtual
* Supports Direct: Yes
* Supports Topic: Yes
* Supports Fanout: No
* Supports Priority: No
* Supports TTL: No

Connection String
=================

To use the Pyro transport with Kombu, use an url of the form:

.. code-block::

    pyro://localhost/kombu.broker

The hostname is where the transport will be looking for a Pyro name server,
which is used in turn to locate the kombu.broker Pyro service.
This broker can be launched by simply executing this transport module directly,
with the command: ``python -m kombu.transport.pyro``

Transport Options
=================
�)�annotationsN)�Empty�Queue)�reraise)�
get_logger)�cached_property�)�virtual)�NamingError)�SerializerBasei�#z5Unable to locate pyro nameserver on host {0.hostname}zKUnable to lookup '{0.virtual_host}' in pyro nameserver on host {0.hostname}cs~eZdZdZ�fdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zedd��Z�ZS)�Channelz
Pyro Channel.cst���|jr|j��dS�N)�super�close�
shared_queuesZ_pyroRelease��self��	__class__��>/usr/local/lib/python3.9/site-packages/kombu/transport/pyro.pyrCs
z
Channel.closecCs
|j��Sr
)r�get_queue_namesrrrr�queuesHszChannel.queuescKs||��vr|j�|�dSr
�rr�	new_queue�r�queue�kwargsrrr�
_new_queueKszChannel._new_queuecKs|j�|�Sr
)r�	has_queuerrrr�
_has_queueOszChannel._has_queueNcCs|�|�}|j�|�Sr
)�
_queue_forr�get)rr�timeoutrrr�_getRs
zChannel._getcCs||��vr|j�|�|Sr
r�rrrrrr!VszChannel._queue_forcKs|�|�}|j�||�dSr
)r!r�put)rr�messagerrrr�_put[s
zChannel._putcCs|j�|�Sr
)r�sizer%rrr�_size_sz
Channel._sizecOs|j�|�dSr
)r�delete)rr�argsrrrr�_deletebszChannel._deletecCs|j�|�Sr
)r�purger%rrr�_purgeeszChannel._purgecCsdSr
rr%rrr�after_reply_message_receivedhsz$Channel.after_reply_message_receivedcCs|jjSr
)�
connectionrrrrrrkszChannel.shared_queues)N)�__name__�
__module__�__qualname__�__doc__rrrr r$r!r(r*r-r/r0rr�
__classcell__rrrrr@s
rcsTeZdZdZeZe��ZeZ	dZ
Z�fdd�Zdd�Z
dd�Zed	d
��Z�ZS)�	TransportzPyro Transport.�pyrocs t�j|fi|��|j|_dSr
)r�__init__�global_state�state)r�clientrrrrr9}szTransport.__init__c	Cs�t�d�|j}ztj|j|jd�}Wn0tyVtttt	�
|��t��d�Yn0z|�
|j�}t�|�WSty�tttt�
|��t��d�Yn0dS)Nz0trying Pyro nameserver to find the broker daemon)�host�port�)�logger�debugr<r8�locateNS�hostname�default_portr
r�E_NAMESERVER�format�sys�exc_info�lookupZvirtual_hostZProxy�E_LOOKUP)rZconninfoZ
nameserver�urirrr�_open�s"
�

�

�zTransport._opencCstjSr
)r8�__version__rrrr�driver_version�szTransport.driver_versioncCs|��Sr
)rLrrrrr�szTransport.shared_queues)r2r3r4r5rr	ZBrokerStater:�DEFAULT_PORTrDZdriver_typeZdriver_namer9rLrNrrr6rrrrr7psr7zqueue.EmptycCst�Sr
)r)�cls�datarrr�<lambda>��rR�single)Z
instance_modec@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�KombuBrokerzmKombu Broker used by the Pyro transport.

        You have to run this as a separate (Pyro) service.
        cCs
i|_dSr
�rrrrrr9�szKombuBroker.__init__cCs
t|j�Sr
)�listrrrrrr�szKombuBroker.get_queue_namescCs||jvrdSt�|j|<dSr
)rrr%rrrr�s
zKombuBroker.new_queuecCs
||jvSr
rVr%rrrr�szKombuBroker.has_queuecCs|j|jdd�S)NF)�block)rr"r%rrrr"�szKombuBroker.getcCs|j|�|�dSr
)rr&)rrr'rrrr&�szKombuBroker.putcCs|j|��Sr
)r�qsizer%rrrr)�szKombuBroker.sizecCs|j|=dSr
rVr%rrrr+�szKombuBroker.deletecCs4z|j|jdd�Wqty,Yq0Yq0qdS)NF)�blocking)rr"rr%rrrr.�szKombuBroker.purgeN)
r2r3r4r5r9rrrr"r&r)r+r.rrrrrU�srU�__main__z,Launching Broker for Kombu's Pyro transport.z'(Expecting a Pyro name server at {}:{})zAYou can connect with Kombu using the url 'pyro://{}/kombu.broker'zkombu.broker)-r5�
__future__rrGrrrZkombu.exceptionsrZ	kombu.logrZkombu.utils.objectsr�r	ZPyro4r8ZPyro4.errorsr
Z
Pyro4.utilr�ImportErrorrOrErJr2r@rr7Zregister_dict_to_classZexposeZbehaviorrU�printZDaemon�daemonrF�configZNS_HOSTZNS_PORTrB�ns�registerrKZrequestLooprrrr�<module>sN"0*
�
*

�
�
,