From 38d52626e85b49f6c28288938ad5f9729f729aa1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 11 Jun 2024 17:43:31 -0700 Subject: [PATCH] daemon: Hold onto and expose connection object --- src/daemon/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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(),