pub struct TaskOrchestrator { /* private fields */ }Expand description
Bridges TaskManager and AgentPool with a dependency-aware
scheduling loop.
Implementations§
Source§impl TaskOrchestrator
impl TaskOrchestrator
Sourcepub fn new(
task_manager: Arc<TaskManager>,
agent_pool: Arc<AgentPool>,
communication_hub: Arc<CommunicationHub>,
config: TaskOrchestratorConfig,
) -> Self
pub fn new( task_manager: Arc<TaskManager>, agent_pool: Arc<AgentPool>, communication_hub: Arc<CommunicationHub>, config: TaskOrchestratorConfig, ) -> Self
Create a new orchestrator.
Sourcepub async fn set_task_config(
&self,
task_id: impl Into<String>,
config: TaskAgentConfig,
)
pub async fn set_task_config( &self, task_id: impl Into<String>, config: TaskAgentConfig, )
Set a per-task agent config override.
Sourcepub async fn set_task_configs(&self, configs: HashMap<String, TaskAgentConfig>)
pub async fn set_task_configs(&self, configs: HashMap<String, TaskAgentConfig>)
Bulk-set per-task agent config overrides.
Sourcepub async fn create_and_run(
&self,
parent_task_id: Option<&str>,
specs: Vec<TaskSpec>,
) -> Result<OrchestrationResult>
pub async fn create_and_run( &self, parent_task_id: Option<&str>, specs: Vec<TaskSpec>, ) -> Result<OrchestrationResult>
Convenience API: create tasks with dependencies in the TaskManager, then run the scheduling loop.
parent_task_id is an optional root task under which all specs are
created as subtasks.
Sourcepub async fn run(&self, root_task_id: &str) -> Result<OrchestrationResult>
pub async fn run(&self, root_task_id: &str) -> Result<OrchestrationResult>
Main scheduling loop over existing tasks in the TaskManager.
Runs until all tasks reachable from root_task_id are completed/failed
or the failure policy halts scheduling.
Sourcepub async fn running_agents(&self) -> HashMap<String, String>
pub async fn running_agents(&self) -> HashMap<String, String>
Map of currently running agent_id -> task_id.
Auto Trait Implementations§
impl Freeze for TaskOrchestrator
impl !RefUnwindSafe for TaskOrchestrator
impl Send for TaskOrchestrator
impl Sync for TaskOrchestrator
impl Unpin for TaskOrchestrator
impl UnsafeUnpin for TaskOrchestrator
impl !UnwindSafe for TaskOrchestrator
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