Trait deterministic::Reactor
source · pub trait Reactor: Sized {
type Peer: ToSocketAddrs;
type Message: Serialize + DeserializeOwned;
type Config;
type Error;
const PERIODIC_INTERVAL: Option<Duration> = None;
fn start(config: Self::Config) -> Result<Self, Self::Error>;
fn receive(
&mut self,
from: Self::Peer,
msg: Self::Message
) -> Vec<(Self::Peer, Self::Message)>;
fn periodic(&mut self) -> Vec<(Self::Peer, Self::Message)> { ... }
}
Expand description
A trait for building networked systems that can be plugged into simulated networks and partition tested in accelerated time.