Expand description
Workload trait for simulation testing.
Workloads define the distributed system behavior to test. Each workload goes through three lifecycle phases:
- Setup: Bind listeners, initialize state (sequential)
- Run: Main logic, all workloads run concurrently
- Check: Validate correctness after quiescence (sequential)
§Usage
ⓘ
use moonpool_sim::{Workload, SimContext, SimulationResult};
struct MyServer;
#[async_trait(?Send)]
impl Workload for MyServer {
fn name(&self) -> &str { "server" }
async fn run(&mut self, ctx: &SimContext) -> SimulationResult<()> {
// server logic...
Ok(())
}
}Traits§
- Workload
- A workload that participates in simulation testing.