Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/kombu/transport/__pycache__/pyro.cpython-39.pyc
Ðазад
a o�h� � @ s� d Z ddlmZ ddlZddlmZmZ ddlmZ ddl m Z ddlmZ dd l mZ z$ddlZdd lmZ ddlmZ W n ey� d Z ZZY n0 dZd ZdZe e�ZG dd� dej�ZG dd� dej�Zedu�re�ddd� � ejejdd�G dd� 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+� W d � n1 �s�0 Y e#�,� W d � n1 �s�0 Y dS )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}c s~ e Zd ZdZ� fdd�Zdd� Zdd� Zdd � Zddd�Zd d� Z dd� Z dd� Zdd� Zdd� Z dd� Zedd� �Z� ZS )�Channelz Pyro Channel.c s t � �� | jr| j�� d S �N)�super�close� shared_queuesZ_pyroRelease��self�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/kombu/transport/pyro.pyr C s z Channel.closec C s | j �� S r )r �get_queue_namesr r r r �queuesH s zChannel.queuesc K s || � � vr| j�|� d S r �r r � new_queue�r �queue�kwargsr r r � _new_queueK s zChannel._new_queuec K s | j �|�S r )r � has_queuer r r r � _has_queueO s zChannel._has_queueNc C s | � |�}| j�|�S r )� _queue_forr �get)r r �timeoutr r r �_getR s zChannel._getc C s || � � vr| j�|� |S r r �r r r r r r! V s zChannel._queue_forc K s | � |�}| j�||� d S r )r! r �put)r r �messager r r r �_put[ s zChannel._putc C s | j �|�S r )r �sizer% r r r �_size_ s z Channel._sizec O s | j �|� d S r )r �delete)r r �argsr r r r �_deleteb s zChannel._deletec C s | j �|�S r )r �purger% r r r �_purgee s zChannel._purgec C s d S r r r% r r r �after_reply_message_receivedh s z$Channel.after_reply_message_receivedc C s | j jS r )� connectionr r r r r r k s zChannel.shared_queues)N)�__name__� __module__�__qualname__�__doc__r r r r r$ r! r( r* r- r/ r0 r r � __classcell__r r r r r @ s r c sT e Zd ZdZeZe�� ZeZ d Z Z� fdd�Zdd� Z dd� Zed d � �Z� ZS )� TransportzPyro Transport.�pyroc s t � j|fi |�� | j| _d S r )r �__init__�global_state�state)r �clientr r r r r9 } s zTransport.__init__c C s� t �d� | j}ztj|j| jd�}W n0 tyV tttt � |��t�� d � Y n0 z|� |j�}t�|�W S ty� tttt� |��t�� d � Y n0 d S )Nz0trying Pyro nameserver to find the broker daemon)�host�port� )�logger�debugr<