cli_config_reciever fn added
parent
df03bd5346
commit
7a5704dd93
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue