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
property
consume
method
(key: string) => Promise<RateLimitResult>reset
method
(key: string) => Promise<void>