pub struct TaskGraph { /* private fields */ }Expand description
Task graph for managing dependencies.
Implementations§
Source§impl TaskGraph
impl TaskGraph
Sourcepub fn remove_task(&self, task_id: TaskId) -> Result<()>
pub fn remove_task(&self, task_id: TaskId) -> Result<()>
Remove a task from the graph.
Sourcepub fn get_tasks_by_status(&self, status: TaskStatus) -> Vec<Arc<RwLock<Task>>>
pub fn get_tasks_by_status(&self, status: TaskStatus) -> Vec<Arc<RwLock<Task>>>
Get tasks by status.
Sourcepub fn update_task_status(
&self,
task_id: TaskId,
status: TaskStatus,
) -> Result<()>
pub fn update_task_status( &self, task_id: TaskId, status: TaskStatus, ) -> Result<()>
Update task status.
Sourcepub fn set_task_result(&self, task_id: TaskId, result: TaskResult) -> Result<()>
pub fn set_task_result(&self, task_id: TaskId, result: TaskResult) -> Result<()>
Set task result.
Sourcepub fn get_cached_result(&self, name: &str) -> Option<Arc<TaskResult>>
pub fn get_cached_result(&self, name: &str) -> Option<Arc<TaskResult>>
Get cached result by task name.
Sourcepub fn clear_result_cache(&self)
pub fn clear_result_cache(&self)
Clear result cache.
Sourcepub fn build_execution_plan(&self) -> Result<ExecutionPlan>
pub fn build_execution_plan(&self) -> Result<ExecutionPlan>
Build execution plan using topological sort.
Sourcepub fn optimize_fusion(&self) -> Result<Vec<(TaskId, TaskId)>>
pub fn optimize_fusion(&self) -> Result<Vec<(TaskId, TaskId)>>
Optimize the graph by fusing compatible tasks.
Sourcepub fn prune_completed(&self) -> Result<usize>
pub fn prune_completed(&self) -> Result<usize>
Prune completed tasks from the graph.
Sourcepub fn get_statistics(&self) -> TaskGraphStatistics
pub fn get_statistics(&self) -> TaskGraphStatistics
Get graph statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaskGraph
impl !RefUnwindSafe for TaskGraph
impl Send for TaskGraph
impl Sync for TaskGraph
impl Unpin for TaskGraph
impl UnsafeUnpin for TaskGraph
impl !UnwindSafe for TaskGraph
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