WorkerPool

Trait WorkerPool 

Source
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§

Source

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 FlowTransactions
  • units - Units of work grouped by flow
  • engine - Engine for processing flows
§Returns

Ok(()) if all units processed successfully, Err if any failed

Source

fn name(&self) -> &str

Get a name for this worker implementation (for logging)

Implementors§