File: //home/arjun/projects/env/lib/python3.10/site-packages/amqp/__pycache__/channel.cpython-310.pyc
o
%we�" � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZ dd l
mZmZmZmZmZmZ dd
lmZ dZe�d�Zd
ZG dd� de�ZG dd� de�ZdS )zAMQP Channels.� N)�defaultdict)�Queue)�ensure_promise� )�spec)�AbstractChannel)�ChannelError�ConsumerCancelled�
MessageNacked�RecoverableChannelError�RecoverableConnectionError�error_for_code)�queue_declare_ok_t)�Channel�amqpzuRejecting message with delivery tag %r for reason of having no callbacks.
consumer_tag=%r exchange=%r routing_key=%r.c @ s e Zd ZdS )�VDeprecationWarningN)�__name__�
__module__�__qualname__� r r �E/home/arjun/projects/env/lib/python3.10/site-packages/amqp/channel.pyr s r c s� e Zd ZdZe�ejjd�e�ejj�e�ejj d�e�ejj
d�e�ejj�e�ejj
�e�ejj�e�ejj�e�ejj�e�ejj�e�ejj�e�ejj
d�e�ejjd�e�ejjd�e�ejjd�e�ejjd�e�ejjd�ejejjddd �e�ejjd�ejejjd
dd �e�ejj�e�ejj�ejejjddd �e�ejj�e�ejj�e�ejj �e�ej!j �e�ejj"d�e�ejj#d�hZ$d
d� e$D �Z$ejjejjfZ% dy� fdd� Z&dzdd�Z'dd� Z(dd� Z)dd� Z* d{dd�Z+dd � Z,d!d"� Z-d#d$� Z.d%d&� Z/d'd(� Z0d)d*� Z1d+d,� Z2 - .d|d/d0�Z3 - 1d}d2d3�Z4 4d~d5d6�Z5 4d~d7d8�Z6 4d~d9d:�Z7 ;dd<d=�Z8 - - >d�d?d@�Z9 - Ad�dBdC�Z:d�dEdF�Z;d�dGdH�Z<d�dJdK�Z=dLdM� Z>dNdO� Z?dPdQ� Z@ - - Rd�dSdT�ZAdUdV� ZBd�dWdX�ZCdzdYdZ�ZDd[d\� ZE ]d�d^d_�ZFeFZGd`da� ZH bd�dcdd�ZId�dedf�ZJd�dgdh�ZKd�didj�ZLdkdl� ZMdmdn� ZNdodp� ZOdqdr� ZPd�dsdt�ZQdudv� ZRdwdx� ZS� ZTS )�r a AMQP Channel.
The channel class provides methods for a client to establish a
virtual connection - a channel - to a server and for both peers to
operate the virtual connection thereafter.
GRAMMAR::
channel = open-channel *use-channel close-channel
open-channel = C:OPEN S:OPEN-OK
use-channel = C:FLOW S:FLOW-OK
/ S:FLOW C:FLOW-OK
/ functional-class
close-channel = C:CLOSE S:CLOSE-OK
/ S:CLOSE C:CLOSE-OK
Create a channel bound to a connection and using the specified
numeric channel_id, and open on the server.
The 'auto_decode' parameter (defaults to True), indicates
whether the library should attempt to decode the body
of Messages to a Unicode string if there's a 'content_encoding'
property for the message. If there's no 'content_encoding'
property, or the decode raises an Exception, the message body
is left as plain bytes.
�BsBB�b�sll�l�s�sLbssT)�content�Lbssl�Bsss�Lbc C s i | ]}|j |�qS r )�
method_sig)�.0�mr r r �
<dictcomp>[ s zChannel.<dictcomp>Nc s� |r|� |� n|�� }t�d|� t� �||� d| _d| _t� | _ i | _
i | _|| _t
t�| _t� | _t|�| _d| _| jjrE| j| _d}d S )Nzusing channel_id: %sFT) �is_open�active�returned_messages� callbacks�cancel_callbacks�events�no_ack_consumers�on_open�_confirm_selected)�_claim_channel_id�_get_free_channel_id�AMQP_LOGGER�debug�super�__init__r% r&