aboutsummaryrefslogtreecommitdiff
path: root/src/util/background
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-14 16:08:05 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-14 16:08:05 +0100
commit510b62010871e9133a98f625b85f07a7e50f6f23 (patch)
tree76aa4190c45571a1feeb92211a591501f116c63f /src/util/background
parentdfc131850a09e7ceacfa98315adbef156e07e9ca (diff)
downloadgarage-510b62010871e9133a98f625b85f07a7e50f6f23.tar.gz
garage-510b62010871e9133a98f625b85f07a7e50f6f23.zip
Get rid of background::spawn
Diffstat (limited to 'src/util/background')
-rw-r--r--src/util/background/mod.rs16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/util/background/mod.rs b/src/util/background/mod.rs
index 0bb4fb67..41b48e93 100644
--- a/src/util/background/mod.rs
+++ b/src/util/background/mod.rs
@@ -2,20 +2,15 @@
pub mod worker;
-use core::future::Future;
-
use std::collections::HashMap;
use std::sync::Arc;
use serde::{Deserialize, Serialize};
use tokio::sync::{mpsc, watch};
-use crate::error::Error;
use worker::WorkerProcessor;
pub use worker::{Worker, WorkerState};
-pub(crate) type JobOutput = Result<(), Error>;
-
/// Job runner for futures and async functions
pub struct BackgroundRunner {
send_worker: mpsc::UnboundedSender<Box<dyn Worker>>,
@@ -77,14 +72,3 @@ impl BackgroundRunner {
.expect("Could not put worker in queue");
}
}
-
-pub fn spawn<T>(job: T)
-where
- T: Future<Output = JobOutput> + Send + 'static,
-{
- tokio::spawn(async move {
- if let Err(e) = job.await {
- error!("{}", e);
- }
- });
-}