File: //var/opt/nydus/ops/mysql/opentelemetry/propagators/__pycache__/composite.cpython-39.pyc
a
�,�h� � @ sp d dl Z d dlZd dlmZ d dlmZ d dlmZ e �e�Z G dd� dej
�Zeddd �G d
d� de��ZdS )� N)�
deprecated)�Context)�textmapc @ s� e Zd ZdZejej dd�dd�Zdej fej
eje ej
ej
ed�dd�Zdejfej
eje ejej
dd �d
d�Zeeje d�d
d��ZdS )�CompositePropagatorz�CompositePropagator provides a mechanism for combining multiple
propagators into a single one.
Args:
propagators: the list of propagators to use
N)�propagators�returnc C s
|| _ d S )N)�_propagators)�selfr � r
�\/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/propagators/composite.py�__init__ s zCompositePropagator.__init__)�carrier�context�getterr c C s | j D ]}|j|||d�}q|S )ak Run each of the configured propagators with the given context and carrier.
Propagators are run in the order they are configured, if multiple
propagators write the same context key, the propagator later in the list
will override previous propagators.
See `mysql.opentelemetry.propagators.textmap.TextMapPropagator.extract`
)r )r �extract)r r
r r �
propagatorr
r
r r # s
zCompositePropagator.extract)r
r �setterr c C s | j D ]}|j|||d� qdS )aj Run each of the configured propagators with the given context and carrier.
Propagators are run in the order they are configured, if multiple
propagators write the same carrier key, the propagator later in the list
will override previous propagators.
See `mysql.opentelemetry.propagators.textmap.TextMapPropagator.inject`
)r N)r �inject)r r
r r r r
r
r r 4 s
zCompositePropagator.inject)r c C s, t � }| jD ]}|jD ]}|�|� qq|S )z�Returns a set with the fields set in `inject`.
See
`mysql.opentelemetry.propagators.textmap.TextMapPropagator.fields`
)�setr �fields�add)r Zcomposite_fieldsr �fieldr
r
r r D s
zCompositePropagator.fields)�__name__�
__module__�__qualname__�__doc__�typing�Sequencer �TextMapPropagatorr Zdefault_getterZCarrierT�Optionalr ZGetterr Zdefault_setterZSetterr �property�Set�strr r
r
r
r r s( �
��
�r z1.2.0z"You should use CompositePropagator)�version�reasonc @ s e Zd ZdZdS )�CompositeHTTPPropagatorzkCompositeHTTPPropagator provides a mechanism for combining multiple
propagators into a single one.
N)r r r r r
r
r
r r% T s r% )
�loggingr r Z#mysql.opentelemetry.context.contextr Zmysql.opentelemetry.propagatorsr � getLoggerr �loggerr r r% r
r
r
r �<module> s
<