File: //var/opt/nydus/ops/mysql/opentelemetry/context/__pycache__/contextvars_context.cpython-39.pyc
a
�,�h� � @ s6 d dl mZ d dlmZmZ G dd� de�ZdgZdS )� )�
ContextVar)�Context�_RuntimeContextc @ sP e Zd ZdZdZdd�dd�Zeed�dd �Zed�d
d�Z edd�d
d�Z
dS )�ContextVarsRuntimeContextz�An implementation of the RuntimeContext interface which wraps ContextVar under
the hood. This is the preferred implementation for usage with Python 3.5+
Zcurrent_contextN)�returnc C s t | jt� d�| _d S )N)�default)r �_CONTEXT_KEYr �_current_context��self� r �b/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/context/contextvars_context.py�__init__ s z"ContextVarsRuntimeContext.__init__)�contextr c C s | j �|�S )z�Sets the current `Context` object. Returns a
token that can be used to reset to the previous `Context`.
Args:
context: The Context to set.
)r �set)r r r r r
�attach s z ContextVarsRuntimeContext.attachc C s
| j �� S )z%Returns the current `Context` object.)r �getr
r r r
�get_current&