pub use harmos_domain::model::services::policy::{RestartPolicy, ServicePolicy};
use std::future::Future;
use crate::operations::ExecutionContext;
pub trait Service: Send + Sized + 'static {
type Error: std::error::Error + Send + Sync + 'static;
fn initialize(context: ExecutionContext) -> impl Future<Output = Result<Self, Self::Error>> + Send;
fn run(&mut self, context: ExecutionContext) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn stop(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send {
async { Ok(()) }
}
fn cleanup(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send {
async { Ok(()) }
}
}