MDCContext

org.llm4s.agent.orchestration.MDCContext
object MDCContext

Thread-safe MDC context management for async operations. Preserves MDC context across thread boundaries. This file needs try-finally to ensure MDC context is restored.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MDCContext.type

Members list

Value members

Concrete methods

def capture(): Map[String, String]

Capture current MDC context

Capture current MDC context

Attributes

def cleanup(keys: String*): Unit

Clean up MDC values after an operation

Clean up MDC values after an operation

Attributes

def preservingExecutionContext(underlying: ExecutionContext): ExecutionContext

Create an ExecutionContext that preserves MDC context

Create an ExecutionContext that preserves MDC context

Attributes

def preservingFuture[T](future: Future[T])(implicit ec: ExecutionContext): Future[T]

Wrap a Future to preserve MDC context

Wrap a Future to preserve MDC context

Attributes

def set(context: Map[String, String]): Unit

Set MDC context from captured map

Set MDC context from captured map

Attributes

def withContext[T](context: Map[String, String])(block: => T): T

Run a block with specific MDC context

Run a block with specific MDC context

Attributes

def withValues[T](values: (String, String)*)(block: => T): T

Run a block with additional MDC values

Run a block with additional MDC values

Attributes