File: //usr/local/lib/python3.9/site-packages/kombu/transport/__pycache__/base.cpython-39.pyc
a
X>h � @ s d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ dd lmZ dd
lmZ er�ddlmZ dZd
efdefdefdefdefd�Zdd� Zdd� Zdd� ZG dd� d�ZG dd� d�ZG dd� de�Zede g d ��dd!�Z!G d"d#� d#�Z"dS )$zBase transport interface.� )�annotationsN)�
TYPE_CHECKING)�RecoverableConnectionError)�ChannelError�ConnectionError)�Message)�
dictfilter)�cached_property)�
maybe_s_to_ms)�
TracebackType)r �
StdChannel�
Management� Transportz x-expiresz
x-message-ttlzx-max-lengthzx-max-length-byteszx-max-priority)�expiresZmessage_ttl�
max_lengthZmax_length_bytesZmax_priorityc K s2 t tdd� |�� D ���}|r.t| fi |��S | S )a! Convert queue arguments to RabbitMQ queue arguments.
This is the implementation for Channel.prepare_queue_arguments
for AMQP-based transports. It's used by both the pyamqp and librabbitmq
transports.
Arguments:
arguments (Mapping):
User-supplied arguments (``Queue.queue_arguments``).
Keyword Arguments:
expires (float): Queue expiry time in seconds.
This will be converted to ``x-expires`` in int milliseconds.
message_ttl (float): Message TTL in seconds.
This will be converted to ``x-message-ttl`` in int milliseconds.
max_length (int): Max queue length (in number of messages).
This will be converted to ``x-max-length`` int.
max_length_bytes (int): Max queue size in bytes.
This will be converted to ``x-max-length-bytes`` int.
max_priority (int): Max priority steps for queue.
This will be converted to ``x-max-priority`` int.
Returns
-------
Dict: RabbitMQ compatible queue arguments.
c s s | ]\}}t ||�V qd S �N)�_to_rabbitmq_queue_argument)�.0�key�value� r �>/usr/local/lib/python3.9/site-packages/kombu/transport/base.py� <genexpr>= s �z.to_rabbitmq_queue_arguments.<locals>.<genexpr>)r �dict�items)� arguments�options�preparedr r r �to_rabbitmq_queue_arguments! s
�
r c C s$ t | \}}||d ur||�n|fS r )�RABBITMQ_QUEUE_ARGUMENTS)r r �opt�typr r r r D s r c C s t d�| j|��S )Nz<Transport {0.__module__}.{0.__name__} does not implement {1})�NotImplementedError�format� __class__)�obj�methodr r r �
_LeftBlankJ s
��r'