summaryrefslogtreecommitdiffstats
path: root/src/service.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-10-15 17:22:31 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-10-15 17:22:31 -0500
commite5c1b2efb597bc7089e833bf570d8217c36f50c3 (patch)
tree5e9dd59db44d824e9df605154575eb3d1b4c79d1 /src/service.rs
parentfd13b0b215a0763fa065038e7add3922059a332c (diff)
refactor: removed unused depsv0.1.0
Diffstat (limited to 'src/service.rs')
-rw-r--r--src/service.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/service.rs b/src/service.rs
index 74ecb1d..1df48be 100644
--- a/src/service.rs
+++ b/src/service.rs
@@ -1,20 +1,17 @@
use serde::Deserialize;
-use crate::Status;
+use crate::{status::Sender, Status};
pub mod command;
pub mod http;
pub mod tcp;
pub trait IntoService {
- fn into_service(
- self,
- tx: tokio::sync::watch::Sender<Status>,
- ) -> impl std::future::Future<Output = ()>;
+ fn into_service(self, tx: Sender) -> impl std::future::Future<Output = ()>;
}
impl IntoService for () {
- async fn into_service(self, tx: tokio::sync::watch::Sender<Status>) {
+ async fn into_service(self, tx: Sender) {
let mut interval = tokio::time::interval(std::time::Duration::from_secs(3));
let mut status = Status::Ok;
@@ -50,7 +47,7 @@ pub enum ServiceKind {
}
impl IntoService for ServiceKind {
- async fn into_service(self, tx: tokio::sync::watch::Sender<Status>) {
+ async fn into_service(self, tx: Sender) {
match self {
ServiceKind::Test(()) => ().into_service(tx).await,
ServiceKind::Http(h) => h.into_service(tx).await,