pub struct TaskRegistry { /* private fields */ }Expand description
Public task registry facade used by executor lifecycle tracking and tests.
Implementations§
Source§impl TaskRegistry
impl TaskRegistry
Sourcepub fn register_task(&mut self) -> u64
pub fn register_task(&mut self) -> u64
Register a new task and return its ID.
Sourcepub fn mark_started(&self, task_id: u64, worker_id: usize)
pub fn mark_started(&self, task_id: u64, worker_id: usize)
Mark a task as started.
Sourcepub fn mark_completed(&self, task_id: u64)
pub fn mark_completed(&self, task_id: u64)
Mark a task as completed.
Sourcepub fn is_completed(&self, task_id: u64) -> bool
pub fn is_completed(&self, task_id: u64) -> bool
Check if a task is completed.
Sourcepub fn get_metadata(&self, task_id: u64) -> Option<TaskMetadata>
pub fn get_metadata(&self, task_id: u64) -> Option<TaskMetadata>
Get task metadata.
Sourcepub fn cleanup_completed(&mut self, older_than: Duration)
pub fn cleanup_completed(&mut self, older_than: Duration)
Remove old completed tasks to prevent retained task metadata growth.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get count of active tasks.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Get count of completed tasks.
Sourcepub fn register_waker(&self, task_id: u64, waker: &Waker) -> bool
pub fn register_waker(&self, task_id: u64, waker: &Waker) -> bool
Register a waker to be notified when the task completes.
Trait Implementations§
Source§impl Debug for TaskRegistry
impl Debug for TaskRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for TaskRegistry
impl !Sync for TaskRegistry
impl Freeze for TaskRegistry
impl Send for TaskRegistry
impl Unpin for TaskRegistry
impl UnsafeUnpin for TaskRegistry
impl UnwindSafe for TaskRegistry
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