Pass config from main to the relevant places

This commit is contained in:
jmb05
2026-11-02 17:06:42 +01:00
parent de1f731e63
commit cdfc5b8d36
13 changed files with 170 additions and 107 deletions

View File

@@ -12,15 +12,21 @@ pub struct ControlSocket {
subscribers: Vec<Sender<ControlCommand>>,
}
impl ControlSocket {
pub fn new() -> Self {
Self {
subscribers: vec![],
}
}
}
impl SimpleBackendThread<ControlCommand> for ControlSocket {
fn subscribers(&self) -> &Vec<Sender<ControlCommand>> {
&self.subscribers
}
fn init(registration_rx: Receiver<Sender<ControlCommand>>) {
let instance = Arc::new(Mutex::new(Self {
subscribers: Vec::new(),
}));
fn init(self, registration_rx: Receiver<Sender<ControlCommand>>) {
let instance = Arc::new(Mutex::new(self));
let instance_clone = instance.clone();
std::thread::spawn(move || {
while let Ok(sender) = registration_rx.recv() {