pub struct TaskDispatcher { /* private fields */ }Expand description
Task dispatcher for load balancing
Implementations§
Source§impl TaskDispatcher
impl TaskDispatcher
Sourcepub fn new(strategy: LoadBalancingStrategy, num_workers: usize) -> Self
pub fn new(strategy: LoadBalancingStrategy, num_workers: usize) -> Self
Create a new task dispatcher
Sourcepub fn dispatch_task(
&self,
task: ParallelTask,
workers: &mut [WorkerState],
) -> SklResult<()>
pub fn dispatch_task( &self, task: ParallelTask, workers: &mut [WorkerState], ) -> SklResult<()>
Dispatch task to appropriate worker
Sourcepub fn update_worker_load(&self, worker_index: usize, delta: i32)
pub fn update_worker_load(&self, worker_index: usize, delta: i32)
Update worker load
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaskDispatcher
impl RefUnwindSafe for TaskDispatcher
impl Send for TaskDispatcher
impl Sync for TaskDispatcher
impl Unpin for TaskDispatcher
impl UnwindSafe for TaskDispatcher
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