enh modulesmanager

This commit is contained in:
ModulatingForce 2023-12-21 12:10:50 -05:00
parent ad137f5530
commit 08f0043f48

View file

@ -67,7 +67,7 @@ struct Routine {}
#[derive(Debug)] #[derive(Debug)]
pub struct ModulesManager { pub struct ModulesManager {
modulesdb: HashMap<ModType,Vec<ModStatusType>>, statusdb: HashMap<ModType,Vec<ModStatusType>>,
botactions: HashMap<ModType,Vec<BotAction>>, botactions: HashMap<ModType,Vec<BotAction>>,
} }
@ -108,7 +108,7 @@ impl ModulesManager {
let mgr = ModulesManager { let mgr = ModulesManager {
modulesdb : m, statusdb : m,
botactions : act, botactions : act,
}; };
@ -142,6 +142,15 @@ impl ModulesManager {
} }
fn statuscleanup(&self,chnl:Option<ChType>) -> () {
// internal cleans up statusdb . For example :
// - remove redudancies . If we see several Enabled("m"), only keep 1x
// - Clarify Conflict. If we see Enabled("m") and Disabled("m") , we remove Enabled("m") and keep Disabled("m")
// the IDEAL is that this is ran before every read/update operation to ensure quality
// Option<ChType> can pass Some(Channel("m")) (as an example) so statuscleanup only works on the given channel
// Passing None to chnl may be a heavy operation, as this will review and look at the whole table
()
}