pub struct SubagentExecutor { /* private fields */ }Expand description
Subagent executor - manages parallel agent execution
Implementations§
Source§impl SubagentExecutor
impl SubagentExecutor
Sourcepub fn new(
config: SubagentConfig,
event_tx: Sender<AgentEvent>,
tools: Vec<Arc<dyn Tool>>,
) -> Self
pub fn new( config: SubagentConfig, event_tx: Sender<AgentEvent>, tools: Vec<Arc<dyn Tool>>, ) -> Self
Create a new subagent executor
§Arguments
config- Subagent configurationevent_tx- Main agent’s event sender for forwardingtools- Available tools from main agent
Sourcepub fn with_defaults(
event_tx: Sender<AgentEvent>,
tools: Vec<Arc<dyn Tool>>,
) -> Self
pub fn with_defaults( event_tx: Sender<AgentEvent>, tools: Vec<Arc<dyn Tool>>, ) -> Self
Create with default configuration
Sourcepub async fn execute(&mut self, task: SubagentTask) -> Result<SubagentResult>
pub async fn execute(&mut self, task: SubagentTask) -> Result<SubagentResult>
Execute a single subagent task
Creates a lightweight Agent instance and runs the task. Events are forwarded to the main agent’s event channel.
Sourcepub async fn execute_parallel(
&mut self,
tasks: Vec<SubagentTask>,
) -> Result<Vec<SubagentResult>>
pub async fn execute_parallel( &mut self, tasks: Vec<SubagentTask>, ) -> Result<Vec<SubagentResult>>
Execute multiple tasks in parallel
Spawns concurrent subagent tasks and collects results. Each task runs independently with its own agent instance.
Sourcepub fn is_cancelled(&self, task_id: &str) -> bool
pub fn is_cancelled(&self, task_id: &str) -> bool
Check if a task is cancelled
Auto Trait Implementations§
impl !RefUnwindSafe for SubagentExecutor
impl !UnwindSafe for SubagentExecutor
impl Freeze for SubagentExecutor
impl Send for SubagentExecutor
impl Sync for SubagentExecutor
impl Unpin for SubagentExecutor
impl UnsafeUnpin for SubagentExecutor
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