cli_config_reciever fn added

feature/configv2
prplV 2025-02-04 16:53:29 +03:00
parent df03bd5346
commit 7a5704dd93
1 changed files with 19 additions and 7 deletions

View File

@ -15,10 +15,13 @@ use tokio::sync::oneshot::Receiver;
// const CONFIG_PATH: &str = "settings.json";
pub mod v2 {
use std::ops::Deref;
use super::*;
pub async fn init_config_mechanism(cli_oneshot: Arc<Receiver<Processes>> /*...*/) { /* local + pubsub + cli oneshot check */ }
pub async fn get_pubsub<'a>(params: Arc<PrebootParams>) -> Option<PubSub<'a>> {
// let config_path = params.config.to_str().unwrap_or_else(|| "settings.json");
pub async fn init_config_mechanism(cli_oneshot: Arc<Receiver<Processes>> /*...*/) {
/* local + pubsub + cli oneshot check */
}
pub async fn get_redis_connection(params: Arc<PrebootParams>) -> Option<Connection> {
if params.no_sub {
return None;
}
@ -31,7 +34,7 @@ pub mod v2 {
// let channel_name = channel_name.trim();
let mut pubsub = conn.as_pubsub();
if pubsub.subscribe(&channel_name.trim()).is_ok() {
todo!()
} else {
@ -51,9 +54,18 @@ pub mod v2 {
None
}
pub async fn get_local_config_watcher(/*...*/) { /*...*/ }
//
pub async fn cli_config_reciever(cli_oneshot: Arc<Receiver<Processes>>) { /*...*/ }
pub async fn get_local_config_watcher(params: Arc<PrebootParams> /*...*/) {
/*...*/
}
// [:IN-TEST]
pub async fn cli_config_reciever(cli_oneshot: Receiver<Processes>) -> Option<Processes> {
/* match awaits til channel*/
match cli_oneshot.await {
Ok(config_from_cli) => return Some(config_from_cli),
_ => None,
}
}
}