Liking cljdoc? Tell your friends :D

com.potetm.fusebox.rate-limit


disableclj

(disable spec)
source

initclj

(init {n :com.potetm.fusebox.rate-limit/bucket-size
       p :com.potetm.fusebox.rate-limit/period-ms
       _to :com.potetm.fusebox.rate-limit/wait-timeout-ms
       :as spec})

Initialize a token bucket rate limiter.

spec is a map containing: ::bucket-size - the integer number of tokens per period ::period-ms - millis in each period ::wait-timeout-ms - max millis a thread waits for a token

Note: A leaky bucket rate limiter can be easily achieved by setting ::bucket-size to 1 and adjusting ::period-ms accordingly.

Initialize a token bucket rate limiter.

 spec is a map containing:
   ::bucket-size     - the integer number of tokens per period
   ::period-ms       - millis in each period
   ::wait-timeout-ms - max millis a thread waits for a token

Note: A leaky bucket rate limiter can be easily achieved by setting
::bucket-size to 1 and adjusting ::period-ms accordingly.
sourceraw docstring

rate-limit*clj

(rate-limit* {s :com.potetm.fusebox.rate-limit/sem
              to :com.potetm.fusebox.rate-limit/wait-timeout-ms
              :as spec}
             f)
source

shutdownclj

(shutdown {bg :com.potetm.fusebox.rate-limit/bg-exec
           s :com.potetm.fusebox.rate-limit/sem})
source

with-rate-limitcljmacro

(with-rate-limit spec & body)

Evaluates body, guarded by the provided rate limiter.

Evaluates body, guarded by the provided rate limiter.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close