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>,
session_manager: Arc<SessionManager>,
) -> Self
pub fn new( registry: Arc<AgentRegistry>, session_manager: Arc<SessionManager>, ) -> Self
Create a new task executor
Sourcepub async fn execute(
&self,
parent_session_id: &str,
params: TaskParams,
event_tx: Option<Sender<AgentEvent>>,
) -> Result<TaskResult>
pub async fn execute( &self, parent_session_id: &str, params: TaskParams, event_tx: Option<Sender<AgentEvent>>, ) -> Result<TaskResult>
Execute a task in a subagent
This creates a child session, runs the prompt, and returns the result.
Sourcepub fn execute_background(
self: Arc<Self>,
parent_session_id: String,
params: TaskParams,
event_tx: Option<Sender<AgentEvent>>,
) -> String
pub fn execute_background( self: Arc<Self>, parent_session_id: String, params: TaskParams, event_tx: Option<Sender<AgentEvent>>, ) -> 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>,
parent_session_id: &str,
tasks: Vec<TaskParams>,
event_tx: Option<Sender<AgentEvent>>,
) -> Vec<TaskResult>
pub async fn execute_parallel( self: &Arc<Self>, parent_session_id: &str, tasks: Vec<TaskParams>, event_tx: Option<Sender<AgentEvent>>, ) -> 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