Skip to main content

sync_agents_batched

Function sync_agents_batched 

Source
async fn sync_agents_batched(
    base: &str,
    registered: &[String],
    token: &str,
    http: &Client,
    mstore: &Arc<Store>,
    handler: &'static ReactiveHandler,
) -> Option<Vec<AgentSyncOutcome>>
Expand description

Every agent in registered pulled in one request (POST /reactive/pending-batch) instead of one GET /reactive/pending/:agent each, then claimed and delivered exactly as sync_agent_reactive does, for each agent with messages. The relay answers each agent as its single route would; this is what keeps an install’s relay traffic from growing with every open agent.

None when the batch isn’t used: fewer than two agents (one pull either way), or a relay without the route. The caller then pulls one agent at a time, as before. An agent the batch couldn’t answer (a failed request, an entry missing) is pulled on its own here.