HTTP rate-limiting (`rateLimit` middleware) ships in the framework already. Per-actor rate limiting is a common adjacent need:
- Cap an actor that processes work-items at N ops/sec.
- Fair-share between many entities sharing an external resource (e.g. DB connection pool, third-party API).
Scope:
- New mailbox decorator or actor-context method: `context.throttle({ qps: 100, burst: 200 })`.
- Token bucket with burst — well-understood algorithm.
- Excess messages either: stash + retry, or drop, or pause-mailbox-until-tokens-available. Configurable.
- Cluster-aware variant: split the budget across all routees of a cluster router (separate sub-issue if needed).
Estimate: 2 days.
Out of scope: distributed token bucket across the whole cluster — that's a Redis-counter-style problem, separate issue.
HTTP rate-limiting (`rateLimit` middleware) ships in the framework already. Per-actor rate limiting is a common adjacent need:
Scope:
Estimate: 2 days.
Out of scope: distributed token bucket across the whole cluster — that's a Redis-counter-style problem, separate issue.