feat(data): pulse sender registry

This commit is contained in:
Nova
2022-06-11 23:49:19 -04:00
parent be46bdfc22
commit 0c1a7af8a5
3 changed files with 54 additions and 0 deletions

View File

@@ -10,10 +10,15 @@ 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 {
@@ -26,6 +31,8 @@ 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()