registerLimit

fun registerLimit(limit: Long, window: Duration, extractKey: RateLimitKeyExtraction)

Register a single limit for the rate limiter.

Note, that they share the key map so the keys should be unique across all limits.

Parameters

limit
  • how many requests can be made during a single window.

window
  • window that counts the requests.

extractKey
  • what request property to use as the key in the cache.

Sources

Link copied to clipboard