An in-memory sliding-window rate limiter: at most max calls per user per rolling window. Per process (see the file header). Time is injectable for tests.
max
Number of users currently tracked (observability / tests).
Counts a call against the user's budget if one remains.
The caller's user id (compared case-insensitively — SQL Server and PostgreSQL disagree).
true when the call is within budget (and has been recorded); false when the budget is spent.
true
false
An in-memory sliding-window rate limiter: at most
maxcalls per user per rolling window. Per process (see the file header). Time is injectable for tests.