(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.
(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.
(with-rate-limit* {s :com.potetm.fusebox.cljs.rate-limit/sem
to :com.potetm.fusebox.cljs.rate-limit/wait-timeout-ms}
f)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close