(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-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-limiter {:keys [rate max-cached-tokens] :as _opts})Create a default rate limiter with:
rate: permits per second (may be a floating point, e.g. 0.5 <=> 1 req every 2 sec)max-cached-tokens: the max size of tokens that the bucket can cache when it's idleCreate a default rate limiter with: * `rate`: permits per second (may be a floating point, e.g. 0.5 <=> 1 req every 2 sec) * `max-cached-tokens`: the max size of tokens that the bucket can cache when it's idle
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 |