Liking cljdoc? Tell your friends :D

diehard-async.rate-limiter


IRateLimitercljprotocol

acquire!clj

(acquire! this)
(acquire! this permits)

Acquire given number of permits. It will block until there are permits available.

Acquire given number of permits. It will block until there are permits available.

try-acquireclj

(try-acquire this)
(try-acquire this permits)
(try-acquire this permits wait-time)

Try to acquire given number of permits, allows blocking for at most wait-ms milliseconds. Return true if there are enough permits in permitted time.

Try to acquire given number of permits, allows blocking for at most `wait-ms` milliseconds.
Return true if there are enough permits in permitted time.

rate-limiterclj

(rate-limiter opts)

Create a default rate limiter with:

  • rate: permits per second
  • max-cached-tokens: the max size of tokens that the bucket can cache when it's idle
Create a default rate limiter with:
* `rate`: permits per second
* `max-cached-tokens`: the max size of tokens that the bucket can cache when it's idle
raw docstring

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

× close