Classrate-limiterv0.1.4-next.0
MemoryRateLimiter
The in-memory IRateLimiter with an exact sliding window per key. The gateway default behind core.rateLimiter.
Each key holds its live uses' expiry times. State is per-process and lost on restart. Expired keys are dropped on the first access at least a minute after the previous sweep.
class MemoryRateLimiter implements Store<"charge">Member visibility
Filter class members by access level.
public get size(): numberpublic async charge(
key: string,
window: RateLimitWindow
): Promise<RateLimitResult>public async peek(
key: string,
window: RateLimitWindow
): Promise<RateLimitResult>