Trait fuel_vm::checked_transaction::ParallelExecutor

source ·
pub trait ParallelExecutor {
    type Task: Future + Send + 'static;

    // Required methods
    fn create_task<F>(func: F) -> Self::Task
       where F: FnOnce() -> Result<(Word, usize), PredicateVerificationFailed> + Send + 'static;
    fn execute_tasks<'async_trait>(
        futures: Vec<Self::Task>,
    ) -> Pin<Box<dyn Future<Output = Vec<Result<(Word, usize), PredicateVerificationFailed>>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Executes CPU-heavy tasks in parallel.

Required Associated Types§

source

type Task: Future + Send + 'static

Future created from a CPU-heavy task.

Required Methods§

source

fn create_task<F>(func: F) -> Self::Task
where F: FnOnce() -> Result<(Word, usize), PredicateVerificationFailed> + Send + 'static,

Creates a Future from a CPU-heavy task.

source

fn execute_tasks<'async_trait>( futures: Vec<Self::Task>, ) -> Pin<Box<dyn Future<Output = Vec<Result<(Word, usize), PredicateVerificationFailed>>> + Send + 'async_trait>>
where Self: 'async_trait,

Executes tasks created by create_task in parallel.

Object Safety§

This trait is not object safe.

Implementors§