aboutsummaryrefslogtreecommitdiffstats
path: root/crates/daemon/src/daemon.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/daemon/src/daemon.rs')
-rw-r--r--crates/daemon/src/daemon.rs21
1 files changed, 2 insertions, 19 deletions
diff --git a/crates/daemon/src/daemon.rs b/crates/daemon/src/daemon.rs
index f3eead19..1c3afcde 100644
--- a/crates/daemon/src/daemon.rs
+++ b/crates/daemon/src/daemon.rs
@@ -110,16 +110,6 @@ impl DaemonHandle {
self.state.settings.read().await
}
- /// Apply already-loaded settings and emit a [`SettingsReloaded`] event.
- ///
- /// Use this when settings have already been loaded (e.g., from a file watcher)
- /// to avoid parsing the config file twice.
- pub(crate) async fn apply_settings(&self, settings: Settings) {
- *self.state.settings.write().await = settings;
- self.emit(DaemonEvent::SettingsReloaded);
- tracing::info!("settings applied");
- }
-
/// Get the encryption key.
pub(crate) fn encryption_key(&self) -> &[u8; 32] {
&self.state.encryption_key
@@ -180,9 +170,7 @@ impl Daemon {
}
/// Run the daemon event loop.
- ///
- /// This processes events until a [`ShutdownRequested`] event is received.
- pub(crate) async fn run_event_loop(&mut self) -> Result<()> {
+ pub(crate) async fn wait_for_shutdown(&mut self) -> Result<()> {
let mut event_rx = self.handle.subscribe();
loop {
match event_rx.recv().await {
@@ -191,8 +179,7 @@ impl Daemon {
break;
}
Ok(event) => {
- tracing::debug!(?event, "processing event");
- self.dispatch_event(&event).await;
+ tracing::debug!(?event, "event received");
}
Err(broadcast::error::RecvError::Lagged(n)) => {
tracing::warn!(
@@ -208,10 +195,6 @@ impl Daemon {
}
Ok(())
}
-
- async fn dispatch_event(&mut self, event: &DaemonEvent) {
- todo!()
- }
}
// ============================================================================