Skip to main content
Version: 1.x

RateLimitAlgorithm

RateLimitAlgorithm

Contract for rate limit algorithms used by the engine.

Signature
interface RateLimitAlgorithm {
readonly type: RateLimitAlgorithmType;
consume(key: string): Promise<RateLimitResult>;
reset(key: string): Promise<void>;
}

type

consume

method
(key: string) => Promise<RateLimitResult>

reset

method
(key: string) => Promise<void>