Skip to main content

Module pace

Module pace 

Source
Expand description

The service pace registry behind a catalog entry’s rate:: one process-global map, seeded at the from_spec chokepoint — the ONLY place every process (reactor, turn worker, flat subagent) constructs its MCP clients — so a rated catalog entry paces its consumers wherever the call actually executes. Buckets are keyed by SERVICE name rather than by server, so every server referencing one entry shares a single bucket per process.

Functions§

register
Called from from_spec for a spec carrying a catalog rate.
take
Spend one token toward server’s service, if it is rated. Ok(()) when unrated or a token was available; Err(msg) (a refusal the caller reports as a tool error, never a crash) when the bucket is dry.