summaryrefslogtreecommitdiffstats
path: root/src/service.rs
diff options
context:
space:
mode:
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,