Table of Contents

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 string

The 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

object

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 T

The value to be set.