Classrate-limiterv0.1.0-next.3
MemoryRateLimiter
The in-memory IRateLimiter with an exact sliding window per key. The gateway default behind core.rateLimitercore.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">class MemoryRateLimiter implements Store<"charge">Member visibility
Filter class members by access level.
public async charge(
key: string,
window: RateLimitWindow
): Promise<RateLimitResult>public async charge(
key: string,
window: RateLimitWindow
): Promise<RateLimitResult>public async peek(
key: string,
window: RateLimitWindow
): Promise<RateLimitResult>public async peek(
key: string,
window: RateLimitWindow
): Promise<RateLimitResult>