(rate-limiter-factory type & {:as opts})Returns a rate limiter factory by type and options. Valid type includes :memory and :redis, for example: ;;Max 100 requests in 1 seconds. (def rt (rate-limiter-factory :memory :interval 1000 :max-in-interval 100))
Returns a rate limiter factory by type and options.
Valid type includes :memory and :redis, for example:
;;Max 100 requests in 1 seconds.
(def rt (rate-limiter-factory :memory
:interval 1000
:max-in-interval 100))
Rate limiter for clojure.
Rate limiter for clojure.
(allow? this id)Return true if the request can be allowd by rate limiter.
Return true if the request can be allowd by rate limiter.
(permit? this id)Return {:result true} if the request can be permited by rate limiter, Otherwise returns {:result false :current requests}.
Return {:result true} if the request
can be permited by rate limiter,
Otherwise returns {:result false :current requests}.(remove-permit this id ts)Remove the permit by id and permit timestamp.
Remove the permit by id and permit timestamp.
A factory to create RateLimiter
A factory to create RateLimiter
(create this)Return an RateLimiter instance.
Return an RateLimiter instance.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |