spawn_agents_with_limit

Function spawn_agents_with_limit 

Source
pub async fn spawn_agents_with_limit(
    configs: impl IntoIterator<Item = SpawnConfig>,
    concurrency: usize,
    event_tx: Sender<AgentEvent>,
) -> Vec<Result<AgentResult, Error>>
Expand description

Spawn multiple agents with bounded concurrency

Unlike spawning all agents at once, this limits how many agent processes run simultaneously to prevent system resource exhaustion.

§Arguments

  • configs - Iterator of spawn configurations
  • concurrency - Maximum number of concurrent agent processes
  • event_tx - Channel for receiving agent events

§Returns

Vector of agent results after all agents complete