pub trait WorkerPool {
// Required methods
fn process(
&self,
txn: &mut StandardCommandTransaction,
units: UnitsOfWork,
engine: &FlowEngine,
) -> Result<()>;
fn name(&self) -> &str;
}Expand description
Trait for different worker pool implementations
Required Methods§
Sourcefn process(
&self,
txn: &mut StandardCommandTransaction,
units: UnitsOfWork,
engine: &FlowEngine,
) -> Result<()>
fn process( &self, txn: &mut StandardCommandTransaction, units: UnitsOfWork, engine: &FlowEngine, ) -> Result<()>
Process a batch of units of work grouped by flow
Each flow’s units are ordered by version and must be processed sequentially. Different flows can be processed in parallel.
§Arguments
txn- Parent transaction for creating FlowTransactionsunits- Units of work grouped by flowengine- Engine for processing flows
§Returns
Ok(()) if all units processed successfully, Err if any failed