pub struct WorkStealingScheduler { /* private fields */ }Expand description
Work-stealing scheduler for parallel level processing
Implementations§
Source§impl WorkStealingScheduler
impl WorkStealingScheduler
Sourcepub fn with_config(config: ParallelConfig) -> Self
pub fn with_config(config: ParallelConfig) -> Self
Create with custom config
Sourcepub fn submit_batch(&self, items: Vec<WorkItem>)
pub fn submit_batch(&self, items: Vec<WorkItem>)
Submit multiple work items
Sourcepub fn complete(&self, result: LevelUpdateResult)
pub fn complete(&self, result: LevelUpdateResult)
Record result
Sourcepub fn get_results(&self) -> HashMap<usize, LevelUpdateResult>
pub fn get_results(&self) -> HashMap<usize, LevelUpdateResult>
Get all results
Sourcepub fn clear_results(&self)
pub fn clear_results(&self)
Clear results
Sourcepub fn queue_size(&self) -> usize
pub fn queue_size(&self) -> usize
Get queue size
Sourcepub fn steal_count(&self) -> u64
pub fn steal_count(&self) -> u64
Get total steals
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WorkStealingScheduler
impl RefUnwindSafe for WorkStealingScheduler
impl Send for WorkStealingScheduler
impl Sync for WorkStealingScheduler
impl Unpin for WorkStealingScheduler
impl UnwindSafe for WorkStealingScheduler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more