reactive_graph_config_impl/
config_system_impl.rs1use std::sync::Arc;
2
3use async_trait::async_trait;
4use springtime_di::Component;
5use springtime_di::component_alias;
6
7use reactive_graph_config_api::ConfigManager;
8use reactive_graph_config_api::ConfigSystem;
9use reactive_graph_lifecycle::Lifecycle;
10
11#[derive(Component)]
12pub struct ConfigSystemImpl {
13 config_manager: Arc<dyn ConfigManager + Send + Sync>,
14}
15
16#[async_trait]
17#[component_alias]
18impl ConfigSystem for ConfigSystemImpl {
19 fn get_config_manager(&self) -> Arc<dyn ConfigManager + Send + Sync> {
20 self.config_manager.clone()
21 }
22}
23
24#[async_trait]
25impl Lifecycle for ConfigSystemImpl {
26 async fn init(&self) {
27 self.config_manager.init().await;
28 }
29
30 async fn post_init(&self) {
31 self.config_manager.post_init().await;
32 }
33
34 async fn pre_shutdown(&self) {
35 self.config_manager.pre_shutdown().await;
36 }
37
38 async fn shutdown(&self) {
39 self.config_manager.shutdown().await;
40 }
41}