use super::communication::{OperatorOperatorComm, WorkerCoordinatorComm};
pub trait RuntimeFlavor {
type Communication: OperatorOperatorComm + WorkerCoordinatorComm;
fn communication(&mut self) -> Result<Self::Communication, CommunicationError>;
fn this_worker_id(&self) -> u64;
}
#[derive(thiserror::Error, Debug)]
#[error(transparent)]
pub struct CommunicationError(#[from] Box<dyn std::error::Error + Send + Sync>);
impl CommunicationError {
pub fn from_error<E>(err: E) -> Self
where
E: std::error::Error + 'static + Send + Sync,
{
Self(Box::new(err))
}
}