pub struct TaskExecutor { /* private fields */ }Expand description
Task executor for running subagent tasks
Implementations§
Source§impl TaskExecutor
impl TaskExecutor
Sourcepub fn new(
registry: Arc<AgentRegistry>,
llm_client: Arc<dyn LlmClient>,
workspace: String,
) -> Self
pub fn new( registry: Arc<AgentRegistry>, llm_client: Arc<dyn LlmClient>, workspace: String, ) -> Self
Create a new task executor
Sourcepub fn with_mcp(
registry: Arc<AgentRegistry>,
llm_client: Arc<dyn LlmClient>,
workspace: String,
mcp_manager: Arc<McpManager>,
) -> Self
pub fn with_mcp( registry: Arc<AgentRegistry>, llm_client: Arc<dyn LlmClient>, workspace: String, mcp_manager: Arc<McpManager>, ) -> Self
Create a new task executor with MCP manager for tool inheritance
Sourcepub async fn execute(
&self,
params: TaskParams,
event_tx: Option<Sender<AgentEvent>>,
sentinel_hook: Option<Arc<dyn HookExecutor>>,
) -> Result<TaskResult>
pub async fn execute( &self, params: TaskParams, event_tx: Option<Sender<AgentEvent>>, sentinel_hook: Option<Arc<dyn HookExecutor>>, ) -> Result<TaskResult>
Execute a task by spawning an isolated child AgentLoop.
Sourcepub fn execute_background(
self: Arc<Self>,
params: TaskParams,
event_tx: Option<Sender<AgentEvent>>,
sentinel_hook: Option<Arc<dyn HookExecutor>>,
) -> String
pub fn execute_background( self: Arc<Self>, params: TaskParams, event_tx: Option<Sender<AgentEvent>>, sentinel_hook: Option<Arc<dyn HookExecutor>>, ) -> String
Execute a task in the background.
Returns immediately with the task ID. Use events to track progress.
Sourcepub async fn execute_parallel(
self: &Arc<Self>,
tasks: Vec<TaskParams>,
event_tx: Option<Sender<AgentEvent>>,
sentinel_hook: Option<Arc<dyn HookExecutor>>,
) -> Vec<TaskResult>
pub async fn execute_parallel( self: &Arc<Self>, tasks: Vec<TaskParams>, event_tx: Option<Sender<AgentEvent>>, sentinel_hook: Option<Arc<dyn HookExecutor>>, ) -> Vec<TaskResult>
Execute multiple tasks in parallel.
Spawns all tasks concurrently and waits for all to complete. Returns results in the same order as the input tasks.
Auto Trait Implementations§
impl Freeze for TaskExecutor
impl !RefUnwindSafe for TaskExecutor
impl Send for TaskExecutor
impl Sync for TaskExecutor
impl Unpin for TaskExecutor
impl UnsafeUnpin for TaskExecutor
impl !UnwindSafe for TaskExecutor
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