[][src]Trait transact::execution::adapter::ExecutionAdapter

pub trait ExecutionAdapter: Send {
    fn start(
        &mut self,
        execution_registry: Box<dyn ExecutionRegistry>
    ) -> Result<(), ExecutionOperationError>;
fn execute(
        &self,
        transaction_pair: TransactionPair,
        context_id: ContextId,
        on_done: Box<dyn Fn(Result<ExecutionTaskCompletionNotification, ExecutionAdapterError>) + Send>
    ) -> Result<(), ExecutionOperationError>;
fn stop(self: Box<Self>) -> Result<(), ExecutionOperationError>; }

Implementers of this trait proxy the transaction to the correct component to execute the transaction.

Required methods

fn start(
    &mut self,
    execution_registry: Box<dyn ExecutionRegistry>
) -> Result<(), ExecutionOperationError>

fn execute(
    &self,
    transaction_pair: TransactionPair,
    context_id: ContextId,
    on_done: Box<dyn Fn(Result<ExecutionTaskCompletionNotification, ExecutionAdapterError>) + Send>
) -> Result<(), ExecutionOperationError>

Execute the transaction and provide an callback that handles the result.

The on_done callback is fired when the transaction returns from processing or there is an error.

fn stop(self: Box<Self>) -> Result<(), ExecutionOperationError>

Stop the internal threads and the Executor will no longer call execute.

Loading content...

Implementors

impl ExecutionAdapter for StaticExecutionAdapter[src]

Loading content...