pub struct AgentPool { /* private fields */ }Expand description
Controlled-parallelism executor for Agents. Clone-safe? No — use one pool
per batch. Methods take &self so tasks can be spawned and consumed from
different code paths concurrently.
Implementations§
Source§impl AgentPool
impl AgentPool
pub fn new() -> Self
Sourcepub fn batch_size(self, n: usize) -> Self
pub fn batch_size(self, n: usize) -> Self
Maximum number of jobs running concurrently.
Sourcepub fn ordering(self, o: PoolStrategy) -> Self
pub fn ordering(self, o: PoolStrategy) -> Self
Select how next() / drain() order results.
Sourcepub async fn spawn(&self, agent: Agent) -> JobId
pub async fn spawn(&self, agent: Agent) -> JobId
Submit a pre-configured agent. Awaits a permit if at capacity.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentPool
impl !RefUnwindSafe for AgentPool
impl Send for AgentPool
impl Sync for AgentPool
impl Unpin for AgentPool
impl UnsafeUnpin for AgentPool
impl !UnwindSafe for AgentPool
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