refactor(registry): use globals instead of storing in event loop

This commit is contained in:
Nova
2022-06-12 00:51:12 -04:00
parent 3ef45a1041
commit 01971b5048
4 changed files with 39 additions and 47 deletions

View File

@@ -10,15 +10,10 @@ use std::rc::Rc;
use std::sync::{Arc, RwLock};
use std::thread::{self, JoinHandle};
use super::registry::Registry;
use crate::nodes::data::PulseSender;
pub struct EventLoop {
pub socket_path: String,
join_handle: RwLock<Option<JoinHandle<Result<()>>>>,
stop_write: pipe::Sender,
pub pulse_senders: Registry<Arc<PulseSender>>,
}
impl EventLoop {
@@ -31,8 +26,6 @@ impl EventLoop {
socket_path,
join_handle: RwLock::new(None),
stop_write: sender,
pulse_senders: Default::default(),
});
let event_loop_arc_captured = event_loop_arc.clone();
let join_handle = thread::Builder::new()