pub struct TaskScheduler { /* private fields */ }Expand description
Task scheduler implementation with pluggable strategies
Implementations§
Source§impl TaskScheduler
impl TaskScheduler
Sourcepub fn new(strategy: SchedulingStrategy, config: SchedulerConfig) -> Self
pub fn new(strategy: SchedulingStrategy, config: SchedulerConfig) -> Self
Create a new task scheduler
Sourcepub fn submit_task(&self, task: ScheduledTask) -> SklResult<()>
pub fn submit_task(&self, task: ScheduledTask) -> SklResult<()>
Submit a task for scheduling
Sourcepub fn get_task_state(&self, task_id: &TaskId) -> Option<TaskState>
pub fn get_task_state(&self, task_id: &TaskId) -> Option<TaskState>
Get task state
Sourcepub fn get_statistics(&self) -> SchedulerStatistics
pub fn get_statistics(&self) -> SchedulerStatistics
Get scheduler statistics
Sourcepub fn cancel_task(&self, task_id: &TaskId) -> SklResult<()>
pub fn cancel_task(&self, task_id: &TaskId) -> SklResult<()>
Cancel a task
Sourcepub fn list_tasks(&self) -> HashMap<TaskId, TaskState>
pub fn list_tasks(&self) -> HashMap<TaskId, TaskState>
List all tasks with their states
Sourcepub fn get_resource_utilization(&self) -> ResourceUtilization
pub fn get_resource_utilization(&self) -> ResourceUtilization
Get current resource utilization
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskScheduler
impl !RefUnwindSafe for TaskScheduler
impl Send for TaskScheduler
impl Sync for TaskScheduler
impl Unpin for TaskScheduler
impl !UnwindSafe for TaskScheduler
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