From a8a7fd8a72f342b2d2105bb5206d0892a4605dd5 Mon Sep 17 00:00:00 2001 From: prplV Date: Wed, 5 Feb 2025 17:50:37 +0300 Subject: [PATCH] init_config_mechanism 50% --- noxis-rs/src/options/config.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/noxis-rs/src/options/config.rs b/noxis-rs/src/options/config.rs index 95f59ee..b55ff33 100644 --- a/noxis-rs/src/options/config.rs +++ b/noxis-rs/src/options/config.rs @@ -11,6 +11,7 @@ use super::preboot::PrebootParams; use tokio::time::{Duration, sleep}; // use redis::PubSub; use tokio::sync::{ + oneshot, oneshot::{ Receiver as OneShotReciever, Sender as OneShotSender }, broadcast::Sender as BroadcastSender, broadcast::Receiver as BroadcastReceiver }; use crate::utils::files::create_watcher; @@ -36,7 +37,20 @@ pub mod v2 { ) { // channel for pubsub to handle local config pulling let _local_config_brd_reciever = brd_tx.subscribe(); - /* local + pubsub + cli oneshot check */ + // channel between pub-sub mech and local config mech + let (tx_pb_lc, rx_pb_lc) = oneshot::channel::(); + // channel between cli mech and local config mech + let (tx_cli_lc, rx_cli_lc) = oneshot::channel::(); + + // future to init work with local config + let lc_future = local_config_reciever( + params, + rx_pb_lc, + rx_cli_lc, + Arc::new(brd_tx) + ); + // TODO! futures + select! + // TODO! tests config } pub async fn get_redis_connection(params: Arc) -> Option { if params.no_sub {