remove rocket dependencies for manager notifications

This commit is contained in:
rmanach
2023-04-22 15:23:33 +02:00
parent e1e8085955
commit 0f5f8a3ec0
5 changed files with 58 additions and 42 deletions
+1 -1
View File
@@ -2,4 +2,4 @@ mod job;
mod traits;
pub use job::{Job, JobAction};
pub use traits::{Runner, RunnerStatus, Storer};
pub use traits::{Notifier, Runner, RunnerStatus, Storer};
+5 -1
View File
@@ -1,4 +1,4 @@
use std::marker::Send;
use std::marker::{Send, Sync};
use crate::error::{MessageError, RunnerError, StorerError};
use crate::message::Message;
@@ -19,6 +19,10 @@ pub trait Runner: Send + 'static {
Self: Sized;
}
pub trait Notifier: Sync + Send + 'static {
fn send(&self, data: Message);
}
pub trait Storer {
fn insert(&self) -> Result<(), StorerError>;
fn save(&self) -> Result<(), StorerError>;