// SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! Process-global access to the shared runtime context state.
//!
//! The public API layer uses this module to resolve the single
//! [`NemoFlowContextState`] instance that owns middleware registrations and
//! runtime extensions for the current process.
use ;
use crateNemoFlowContextState;
static GLOBAL_CONTEXT: OnceLock =
new;
/// Return the process-global runtime context state handle.
///
/// This lazily initializes the shared [`NemoFlowContextState`] on first use and
/// returns a cloned [`Arc`] handle to the same underlying [`RwLock`] on every
/// subsequent call.
///
/// # Returns
/// An [`Arc`] pointing at the singleton [`RwLock`] that stores the runtime
/// context state for the current process.
///
/// # Notes
/// All callers share the same underlying state. Mutations made through one
/// handle are visible through every other handle returned by this function.