Struct DispatchTextAgent
pub struct DispatchTextAgent { /* private fields */ }Expand description
Fire-and-forget background task launcher with global task budget.
Launches each child agent as a background tokio::spawn task,
stores handles in a TaskRegistry, and returns immediately.
Implementations§
§impl DispatchTextAgent
impl DispatchTextAgent
pub fn new(
name: impl Into<String>,
children: Vec<(String, Arc<dyn TextAgent>)>,
registry: TaskRegistry,
budget: Arc<Semaphore>,
) -> DispatchTextAgent
pub fn new( name: impl Into<String>, children: Vec<(String, Arc<dyn TextAgent>)>, registry: TaskRegistry, budget: Arc<Semaphore>, ) -> DispatchTextAgent
Create a new dispatch agent with named children and a concurrency budget.
Trait Implementations§
§impl TextAgent for DispatchTextAgent
impl TextAgent for DispatchTextAgent
§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
DispatchTextAgent: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
DispatchTextAgent: 'async_trait,
Execute this agent. Reads/writes
state. Returns the final text output.Auto Trait Implementations§
impl Freeze for DispatchTextAgent
impl !RefUnwindSafe for DispatchTextAgent
impl Send for DispatchTextAgent
impl Sync for DispatchTextAgent
impl Unpin for DispatchTextAgent
impl !UnwindSafe for DispatchTextAgent
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