GatewayConcurrencyPolicyProtocol
Defined in the protocols module.AI Agent Protocol for gateway-wide inbound admission decisions. Pure, import-free decision contract consumed by the wrapper’s run-dispatch path. The wrapper supplies the live aggregate counts (turns currently in flight and turns currently waiting) and the policy decides whether the next inbound turn may run now, must wait, or should be shed. Concrete enforcement (an
asyncio.Semaphore ceiling plus a bounded
asyncio.Queue with per-session fairness) lives in the wrapper, since it
needs the running event loop and live session manager; this contract keeps
the decision testable in isolation.
A config-driven default (:class:ConcurrencyLimitPolicy) is provided for
the common “N concurrent runs, bounded wait queue, declared overflow”
case.
Properties
int
No description available.
int
No description available.
Methods
decide()
Return an :class:
AdmissionDecision for the supplied facts.Source
View on GitHub
praisonaiagents/gateway/protocols.py at line 3193
