use anyhow::Result;
use async_once_cell::OnceCell;
use std::{
collections::HashMap,
sync::{Arc, Weak},
};
use tokio::sync::Mutex;
use crate::component::{Registry, RegistryInner};
impl Default for Registry {
fn default() -> Self {
Self::new()
}
}
impl Registry {
pub fn new() -> Self {
Self {
inner: Arc::new(Mutex::new(RegistryInner::default())),
is_static: false,
}
}
pub fn new_with_static(is_static: bool) -> Self {
Self {
inner: Arc::new(Mutex::new(RegistryInner::default())),
is_static,
}
}
pub fn is_static(&self) -> bool {
self.is_static
}
}