Class RuntimeContext
Defined in File runtime_context.h
Class Documentation
-
class RuntimeContext
Public Static Functions
-
static inline Context SetValue(nostd::string_view key, const ContextValue &value, Context *context = nullptr) noexcept
-
static inline ContextValue GetValue(nostd::string_view key, Context *context = nullptr) noexcept
Provide a custom runtime context storage.
This provides a possibility to override the default thread-local runtime context storage. This has to be set before any spans are created by the application, otherwise the behavior is undefined.
- Parameters:
storage – a custom runtime context storage
-
static inline nostd::shared_ptr<const RuntimeContextStorage> GetConstRuntimeContextStorage() noexcept
Provide a pointer to const runtime context storage.
The returned pointer can only be used for extending the lifetime of the runtime context storage.
-
static inline Context SetValue(nostd::string_view key, const ContextValue &value, Context *context = nullptr) noexcept