Liking cljdoc? Tell your friends :D

com.potetm.fusebox.cljs.rate-limit


disablecljs

(disable spec)
source

initcljs

(init {n :com.potetm.fusebox.cljs.rate-limit/bucket-size
       p :com.potetm.fusebox.cljs.rate-limit/period-ms
       to :com.potetm.fusebox.cljs.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

shutdowncljs

(shutdown {i :com.potetm.fusebox.cljs.rate-limit/interval})
source

with-rate-limitclj/smacro

(with-rate-limit spec & body)

Evaluates body which returns a promise, guarded by the provided rate limiter.

Evaluates body which returns a promise, guarded by the provided rate limiter.
sourceraw docstring

with-rate-limit*cljs

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

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

× close