Skip to main content

dynamo_runtime/component/
registry.rs

1// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use anyhow::Result;
5use async_once_cell::OnceCell;
6use std::{
7    collections::HashMap,
8    sync::{Arc, Weak},
9};
10use tokio::sync::Mutex;
11
12use crate::component::{Registry, RegistryInner};
13
14impl Default for Registry {
15    fn default() -> Self {
16        Self::new()
17    }
18}
19
20impl Registry {
21    pub fn new() -> Self {
22        Self {
23            inner: Arc::new(Mutex::new(RegistryInner::default())),
24        }
25    }
26}