Pass config from main to the relevant places
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user