File: //home/arjun/projects/env/lib/python3.10/site-packages/kombu/__pycache__/messaging.cpython-310.pyc
o
'we�^ � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZm
Z
dd lmZmZmZ dd
lmZ ddlmZmZ ddlmZmZ erPdd
lmZ dZG dd� d�ZG dd� d�ZdS )zSending and receiving messages.� )�annotations)�count)�
TYPE_CHECKING� ��
maybe_declare)�compress)�
is_connection�
maybe_channel)�Exchange�Queue�maybe_delivery_mode)�ContentDisallowed)�dumps�prepare_accept_content)�ChannelPromise�
maybe_list)�
TracebackType)r r �Producer�Consumerc @ s� e Zd ZdZdZdZdZdZdZdZ dZ
d1dd�Zdd� Zd d
� Z
dd� Zd
d� Zd2dd�Zdeefdd�Z d3dd�Z d4dd�Zdd� Zdd� Zeee�Zdd� Zdd � Zd5d)d*�Zd+d,� ZeZ d6d-d.�Zed/d0� �Z dS )7r a� Message Producer.
Arguments:
---------
channel (kombu.Connection, ChannelT): Connection or channel.
exchange (kombu.entity.Exchange, str): Optional default exchange.
routing_key (str): Optional default routing key.
serializer (str): Default serializer. Default is `"json"`.
compression (str): Default compression method.
Default is no compression.
auto_declare (bool): Automatically declare the default exchange
at instantiation. Default is :const:`True`.
on_return (Callable): Callback to call for undeliverable messages,
when the `mandatory` or `immediate` arguments to
:meth:`publish` is used. This callback needs the following
signature: `(exception, exchange, routing_key, message)`.
Note that the producer needs to drain events to use this feature.
N� Tc C s~ || _ || _|p
| j| _|p| j| _|p| j| _|p| j| _d | _| jd u r+td�| _|d ur2|| _| j r=| � | j � d S d S )Nr )
�_channel�exchange�routing_key�
serializer�compression� on_return�_channel_promiser �auto_declare�revive)�self�channelr r r r r r � r"