Skip to main content

Process

Trait Process 

Source
pub trait Process: 'static {
    // Required methods
    fn name(&self) -> &str;
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 SimContext,
    ) -> Pin<Box<dyn Future<Output = SimulationResult<()>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A process that participates in simulation as part of the system under test.

Processes are the primary unit of server behavior. A fresh instance is created from the factory on every boot (first boot and every reboot). State only persists through storage, not in-memory fields.

The process reads its tags and index from SimContext to determine its role.

Required Methods§

Source

fn name(&self) -> &str

Name of this process type for reporting.

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 mut self, ctx: &'life1 SimContext, ) -> Pin<Box<dyn Future<Output = SimulationResult<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run the process. Called on each boot (first boot and every reboot).

The SimContext has fresh providers each boot. The process should bind listeners, establish connections, and run its main loop.

Returns when the process exits voluntarily, or gets cancelled on reboot.

Implementors§