Skip to main content

ParallelExecutor

Trait ParallelExecutor 

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

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

Executes tasks created by create_task in parallel.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§