WorkerPool

Trait WorkerPool 

Source
pub trait WorkerPool {
    // Required methods
    fn process<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        txn: &'life1 mut StandardCommandTransaction,
        units: UnitsOfWork,
        engine: &'life2 FlowEngine,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Trait for different worker pool implementations

Required Methods§

Source

fn process<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, txn: &'life1 mut StandardCommandTransaction, units: UnitsOfWork, engine: &'life2 FlowEngine, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

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§