redisPartitionLimiter
redisPartitionLimiter<
T>(options): (key,source) =>RateLimiterStrategy<T>
Defined in: src/redis.ts:201
limiter factory for PartitionedRateLimiterStrategy: one Redis-backed limit per partition key, shared by every instance.
Evicting an idle partition only drops the local object; its count lives on in Redis until the window passes.
builder.addPartitionedRateLimiter({ partitionKey: (ctx) => ctx.properties.get('userId') as string, limiter: redisPartitionLimiter({ client, permitLimit: 100, window: '1m', queueTimeout: '1s' }),});// same as: limiter: (key, s) => new RateLimiterStrategy(new RedisRateLimiter({ client, key, permitLimit, window }), opts, s)Type Parameters
Section titled “Type Parameters”T = any
Parameters
Section titled “Parameters”options
Section titled “options”Omit<RedisRateLimiterOptions, "key"> & PermitRateLimiterOptions
Returns
Section titled “Returns”(key, source) => RateLimiterStrategy<T>