pub struct TaskQueue { /* private fields */ }Expand description
A task queue with dependency resolution (topological ordering).
Implementations§
Source§impl TaskQueue
impl TaskQueue
Sourcepub fn next_ready(&self) -> Option<&Task>
pub fn next_ready(&self) -> Option<&Task>
Get the next ready task (all dependencies resolved, status == Pending). Returns tasks in creation-time order among those that are ready.
Sourcepub fn mark_running(&mut self, id: Uuid) -> bool
pub fn mark_running(&mut self, id: Uuid) -> bool
Mark a task as running.
Sourcepub fn mark_completed(&mut self, id: Uuid) -> bool
pub fn mark_completed(&mut self, id: Uuid) -> bool
Mark a task as completed.
Sourcepub fn mark_failed(&mut self, id: Uuid, reason: String) -> bool
pub fn mark_failed(&mut self, id: Uuid, reason: String) -> bool
Mark a task as failed.
Sourcepub fn mark_needs_review(&mut self, id: Uuid) -> bool
pub fn mark_needs_review(&mut self, id: Uuid) -> bool
Mark a task as needing human review (HITL).
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Count of pending tasks.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Count of completed tasks.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total number of tasks.
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Check if all tasks are in a terminal state (completed, failed, or awaiting review).
Sourcepub fn needs_review_count(&self) -> usize
pub fn needs_review_count(&self) -> usize
Count of tasks awaiting human review.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskQueue
impl RefUnwindSafe for TaskQueue
impl Send for TaskQueue
impl Sync for TaskQueue
impl Unpin for TaskQueue
impl UnsafeUnpin for TaskQueue
impl UnwindSafe for TaskQueue
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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> 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