summaryrefslogtreecommitdiffstats
path: root/src/service
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
parentfd13b0b215a0763fa065038e7add3922059a332c (diff)
refactor: removed unused depsv0.1.0
Diffstat (limited to 'src/service')
-rw-r--r--src/service/command.rs11
-rw-r--r--src/service/http.rs4
-rw-r--r--src/service/tcp.rs4
3 files changed, 8 insertions, 11 deletions
diff --git a/src/service/command.rs b/src/service/command.rs
index 6b44e1d..7f3bd59 100644
--- a/src/service/command.rs
+++ b/src/service/command.rs
@@ -1,12 +1,9 @@
use std::{process::Stdio, time::Duration};
use serde::{Deserialize, Serialize};
-use tokio::{
- io::{AsyncBufReadExt, BufReader},
- sync::watch::Sender,
-};
+use tokio::io::{AsyncBufReadExt, BufReader};
-use crate::Status;
+use crate::status::Sender;
use super::IntoService;
@@ -43,7 +40,7 @@ pub struct Command {
}
impl Command {
- async fn persist(&self, tx: Sender<Status>) -> Result<(), Error> {
+ async fn persist(&self, tx: Sender) -> Result<(), Error> {
let mut command = tokio::process::Command::new(&self.command);
command.args(&self.args);
@@ -83,7 +80,7 @@ impl Command {
}
impl IntoService for Command {
- async fn into_service(self, tx: tokio::sync::watch::Sender<Status>) {
+ async fn into_service(self, tx: Sender) {
let mut interval = tokio::time::interval(self.interval);
loop {
interval.tick().await;
diff --git a/src/service/http.rs b/src/service/http.rs
index bfba007..5b0fdd5 100644
--- a/src/service/http.rs
+++ b/src/service/http.rs
@@ -5,7 +5,7 @@ use reqwest::Client;
use serde::{Deserialize, Serialize};
use url::Url;
-use crate::Status;
+use crate::status::Sender;
use super::IntoService;
@@ -47,7 +47,7 @@ impl Http {
}
impl IntoService for Http {
- async fn into_service(self, tx: tokio::sync::watch::Sender<Status>) {
+ async fn into_service(self, tx: Sender) {
let mut interval = tokio::time::interval(self.interval);
loop {
interval.tick().await;
diff --git a/src/service/tcp.rs b/src/service/tcp.rs
index e28b19d..974d2f6 100644
--- a/src/service/tcp.rs
+++ b/src/service/tcp.rs
@@ -3,7 +3,7 @@ use std::{fmt::Display, net::SocketAddr, time::Duration};
use serde::{Deserialize, Serialize};
use tokio::{io::Interest, net::TcpSocket};
-use crate::Status;
+use crate::status::Sender;
use super::IntoService;
@@ -33,7 +33,7 @@ impl Tcp {
}
impl IntoService for Tcp {
- async fn into_service(self, tx: tokio::sync::watch::Sender<Status>) {
+ async fn into_service(self, tx: Sender) {
let mut interval = tokio::time::interval(self.interval);
loop {