diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-10-01 13:15:24 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-10-01 13:15:24 -0500 |
commit | fe16a923190243dfde5db6ceff2ef0bcf9158926 (patch) | |
tree | 9b8b616e1972ca3ef6e28d29c980899af3ddde49 /src/service.rs | |
parent | e1d9c956beb6921b0d549248bea3a6853fde5f46 (diff) |
feat: simplify service status type
Diffstat (limited to 'src/service.rs')
-rw-r--r-- | src/service.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/service.rs b/src/service.rs index c45fcb1..8e0863c 100644 --- a/src/service.rs +++ b/src/service.rs @@ -6,7 +6,7 @@ use serde::Deserialize; use systemd::Systemd; use tcp::Tcp; use tokio::{ - sync::watch::{Receiver, Sender}, + sync::watch::{channel, Receiver, Sender}, task::JoinHandle, }; use tokio_stream::wrappers::WatchStream; @@ -34,7 +34,7 @@ pub struct ServiceHandle { impl ServiceHandle { pub fn new(service: impl ServiceSpawner) -> Self { - let (tx, rx) = tokio::sync::watch::channel(Status::default()); + let (tx, rx) = channel(Status::Error(None)); let handle = tokio::spawn(service.spawn(tx)); Self { handle, rx } } |