diff --git a/src/daemon/mod.rs b/src/daemon/mod.rs index b88ca92..f2dae35 100644 --- a/src/daemon/mod.rs +++ b/src/daemon/mod.rs @@ -60,6 +60,7 @@ pub(crate) trait DaemonContext: Sized { pub(crate) struct Daemon { services: JoinSet>, token: CancellationToken, + connection: Connection, channel: Receiver>, } @@ -90,6 +91,7 @@ impl Daemon { services, token, channel, + connection, }; daemon.add_service(log_receiver); @@ -104,6 +106,10 @@ impl Daemon { token } + pub(crate) fn get_connection(&self) -> Connection { + self.connection.clone() + } + pub(crate) async fn run(&mut self, mut context: C) -> Result<()> { ensure!( !self.services.is_empty(),