ThrottlerStorage


interface ThrottlerStorage {
  increment(key: string, ttl: number, limit: number, blockDuration: number, throttlerName: string): Promise<ThrottlerStorageRecord>
}

Methods

increment()

Increment the amount of requests for a given record. The record will automatically be removed from the storage once its TTL has been reached.


increment(key: string, ttl: number, limit: number, blockDuration: number, throttlerName: string): Promise<ThrottlerStorageRecord>

Parameters

Option Type Description
key string
ttl number
limit number
blockDuration number
throttlerName string

Returns

Promise<ThrottlerStorageRecord>