Merge branch 'master' into feature/nginx-handler
All checks were successful
Test / get-ci-image (pull_request) Successful in 6s
Test / test-frontend (pull_request) Successful in 12s
Test / lint-frontend (pull_request) Successful in 15s
Test / frontend-build (pull_request) Successful in 13s
Verify / get-ci-image (pull_request) Successful in 5s
Test / lint-crates (pull_request) Successful in 5m4s
Test / test-crates (pull_request) Successful in 5m9s
Verify / verify-generated-db-entities (pull_request) Successful in 5m57s

This commit is contained in:
GW_MC
2026-04-16 05:03:05 +00:00
15 changed files with 586 additions and 7 deletions

View File

@@ -0,0 +1,38 @@
use std::sync::Arc;
use nxmesh_proto::ConfigUpdate;
use tracing::info;
use crate::connector::master::MasterConnector;
#[async_trait::async_trait]
pub trait MasterHandler {
async fn on_config_update(
&self,
config_info: ConfigUpdate,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>>;
}
pub struct MasterHandlerImpl {
settings: Arc<crate::config::settings::Settings>,
}
impl MasterHandlerImpl {
pub fn new(settings: impl Into<Arc<crate::config::settings::Settings>>) -> Self {
Self {
settings: settings.into(),
}
}
}
#[async_trait::async_trait]
impl MasterHandler for MasterHandlerImpl {
async fn on_config_update(
&self,
config_info: ConfigUpdate,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
info!("Received config update from master: {:?}", config_info);
Ok(())
}
}