File: //home/arjun/projects/env/lib/python3.10/site-packages/kombu/__pycache__/message.cpython-310.pyc
o
'we� � @ st d Z ddlmZ ddlZddlmZ ddlmZmZ ddl m
Z
ddlmZ d Z
h d
�Zeed�ZG dd
� d
�ZdS )zMessage class.� )�annotationsN� )�
decompress)�MessageStateError�reraise)�loads)�
dictfilter)�Message> �ACK�REJECTED�REQUEUED�pypy_version_infoc @ s� e Zd ZdZeZdZesdZ ddd�Zddd�Z dd d
�Z
ddd�Zdd
d�Zddd�Z
dd� Zdd� Zdd� Zedd� �Zedd� �Zdd� ZdS ) r au Base class for received messages.
Keyword Arguments:
-----------------
channel (ChannelT): If message was received, this should be the
channel that the message was received on.
body (str): Message body.
delivery_mode (bool): Set custom delivery mode.
Defaults to :attr:`delivery_mode`.
priority (int): Message priority, 0 to broker configured
max priority, where higher is better.
content_type (str): The messages content_type. If content_type
is set, no serialization occurs as it is assumed this is either
a binary object, or you've done your own serialization.
Leave blank if using built-in serialization as our library
properly sets content_type.
content_encoding (str): The character set in which this object
is encoded. Use "binary" if sending in raw binary objects.
Leave blank if using built-in serialization as our library
properly sets content_encoding.
properties (Dict): Message properties.
headers (Dict): Message headers.
N)�_state�channel�delivery_tag�content_type�content_encoding�
delivery_info�headers�
properties�body�_decoded_cache�accept�__dict__c
K s� |si n|}| j d u r
g n| j | _ |
| _|| _|| _|| _|| _|p#i | _|p(i | _d | _d| _ | | _
| j�d�}| j sW|rWzt||�}W n t
yV | j �t�� � Y nw | j sz|rzt|t�rzz|�|�}W n t
yy | j �t�� � Y nw || _d S )N�RECEIVED�compression)�errorsr r r r r r r r r r �getr � Exception�append�sys�exc_info�
isinstance�str�encoder )
�selfr r r r r r r �
postencoder r �kwargsr � r( �F/home/arjun/projects/env/lib/python3.10/site-packages/kombu/message.py�__init__>