WorkStealingTask

Trait WorkStealingTask 

Source
pub trait WorkStealingTask: Send + 'static {
    type Output: Send + 'static;

    // Required method
    fn execute(self) -> Self::Output;

    // Provided methods
    fn estimated_duration(&self) -> Option<Duration> { ... }
    fn estimated_memory(&self) -> Option<usize> { ... }
    fn can_split(&self) -> bool { ... }
    fn split(self) -> Vec<Box<dyn WorkStealingTask<Output = Self::Output>>>
       where Self: Sized { ... }
}
Expand description

A task that can be executed by the work-stealing scheduler

Required Associated Types§

Source

type Output: Send + 'static

The result type produced by this task

Required Methods§

Source

fn execute(self) -> Self::Output

Execute the task and return the result

Provided Methods§

Source

fn estimated_duration(&self) -> Option<Duration>

Get the estimated execution time (for load balancing)

Source

fn estimated_memory(&self) -> Option<usize>

Get the estimated memory usage (for NUMA scheduling)

Source

fn can_split(&self) -> bool

Check if this task can be split into smaller tasks

Source

fn split(self) -> Vec<Box<dyn WorkStealingTask<Output = Self::Output>>>
where Self: Sized,

Split this task into smaller tasks (if supported)

Implementors§