RateLimiterLike
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
Defined in: packages/pipeline-rate-limit/src/interfaces/rate-limiter.interface.ts:27
Minimal structural shape of a rate-limiter-flexible limiter
(RateLimiterAbstract). Any of its backends —
RateLimiterMemory, RateLimiterRedis, RateLimiterMongo,
RateLimiterPostgres, RateLimiterMySQL, … — satisfies this interface, so
they are genuine drop-in replacements. Add it in your app:
pnpm add rate-limiter-flexible.
Properties
Section titled “Properties”points?
Section titled “points?”
readonlyoptionalpoints?:number
Defined in: packages/pipeline-rate-limit/src/interfaces/rate-limiter.interface.ts:36
The configured point capacity per window, when the limiter exposes it.
Methods
Section titled “Methods”consume()
Section titled “consume()”consume(
key,points?):Promise<RateLimiterResLike>
Defined in: packages/pipeline-rate-limit/src/interfaces/rate-limiter.interface.ts:34
Consume points (default 1) for key. Resolves with the updated
RateLimiterResLike when allowed, or rejects with a
RateLimiterResLike when the limit is exceeded (and with a plain
Error when the backing store itself fails).
Parameters
Section titled “Parameters”string
points?
Section titled “points?”number