Class AsyncLocalRuntimeContextSlot<T>
- Namespace
- OpenTelemetry.Context
- Assembly
- OpenTelemetry.Api.dll
The async local implementation of context slot.
public class AsyncLocalRuntimeContextSlot<T> : RuntimeContextSlot<T>, IDisposable, IRuntimeContextSlotValueAccessor
Type Parameters
T
The type of the underlying value.
- Inheritance
-
AsyncLocalRuntimeContextSlot<T>
- Implements
- Inherited Members
Constructors
AsyncLocalRuntimeContextSlot(string)
Initializes a new instance of the AsyncLocalRuntimeContextSlot<T> class.
public AsyncLocalRuntimeContextSlot(string name)
Parameters
name
stringThe name of the context slot.
Properties
Value
Gets or sets the value of the slot as an object.
public object Value { get; set; }
Property Value
Methods
Get()
Get the value from the context slot.
public override T Get()
Returns
- T
The value retrieved from the context slot.
Set(T)
Set the value to the context slot.
public override void Set(T value)
Parameters
value
TThe value to be set.