pub struct TaskScheduler { /* private fields */ }Expand description
Task scheduler for managing task execution order.
Implementations§
Source§impl TaskScheduler
impl TaskScheduler
Sourcepub fn mark_running(&mut self, task: Task, worker_id: String)
pub fn mark_running(&mut self, task: Task, worker_id: String)
Mark a task as running.
Sourcepub fn mark_completed(&mut self, task_id: TaskId) -> Result<()>
pub fn mark_completed(&mut self, task_id: TaskId) -> Result<()>
Mark a task as completed.
Sourcepub fn mark_failed(&mut self, task_id: TaskId) -> Result<()>
pub fn mark_failed(&mut self, task_id: TaskId) -> Result<()>
Mark a task as failed and potentially retry.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get the number of pending tasks.
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Get the number of running tasks.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Get the number of completed tasks.
Sourcepub fn failed_count(&self) -> usize
pub fn failed_count(&self) -> usize
Get the number of failed tasks.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all tasks are complete.
Trait Implementations§
Source§impl Debug for TaskScheduler
impl Debug for TaskScheduler
Auto Trait Implementations§
impl Freeze for TaskScheduler
impl RefUnwindSafe for TaskScheduler
impl Send for TaskScheduler
impl Sync for TaskScheduler
impl Unpin for TaskScheduler
impl UnsafeUnpin 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request