pub trait ExecutorTask: Sync {
    type T: Transaction;
    type Output: TransactionOutput<T = Self::T>;
    type Error: Clone + Send + Sync;
    type Argument: Sync + Copy;

    // Required methods
    fn init(args: Self::Argument) -> Self;
    fn execute_transaction(
        &self,
        view: MVHashMapView<'_, <Self::T as Transaction>::Key, <Self::T as Transaction>::Value>,
        txn: &Self::T
    ) -> ExecutionStatus<Self::Output, Self::Error>;
}
Expand description

Trait for single threaded transaction executor.

Required Associated Types§

source

type T: Transaction

Type of transaction and its associated key and value.

source

type Output: TransactionOutput<T = Self::T>

The output of a transaction. This should contain the side effect of this transaction.

source

type Error: Clone + Send + Sync

Type of error when the executor failed to process a transaction and needs to abort.

source

type Argument: Sync + Copy

Type to intialize the single thread transaction executor. Copy and Sync are required because we will create an instance of executor on each individual thread.

Required Methods§

source

fn init(args: Self::Argument) -> Self

Create an instance of the transaction executor.

source

fn execute_transaction( &self, view: MVHashMapView<'_, <Self::T as Transaction>::Key, <Self::T as Transaction>::Value>, txn: &Self::T ) -> ExecutionStatus<Self::Output, Self::Error>

Execute one single transaction given the view of the current state.

Implementors§

source§

impl<K, V> ExecutorTask for Task<K, V>where K: PartialOrd + Send + Sync + Clone + Hash + Eq + 'static, V: Send + Sync + Debug + Clone + 'static,

§

type T = Transaction<K, V>

§

type Output = Output<K, V>

§

type Error = usize

§

type Argument = ()