ex_limiter v1.3.5 ExLimiter.Storage.Memcache View Source
Token bucket backend written for memcache. Stores the last timestamp and amount in separate keys, and utilizes memcache increments for consumption
Link to this section Summary
Functions
Consumes n elements from the bucket (atomically)
Callback implementation for ExLimiter.Storage.delete/1
Fetch the current state of the given bucket
Callback implementation for ExLimiter.Storage.refresh/2
Atomically update the bucket denoted by key
with fun
. Leverage whatever
concurrency controls are available in the given storage mechanism (eg cas for memcached)
Link to this section Functions
consume(bucket, inc) View Source
Consumes n elements from the bucket (atomically)
Callback implementation for ExLimiter.Storage.consume/2
.
delete(bucket) View Source
Callback implementation for ExLimiter.Storage.delete/1
.
fetch(bucket) View Source
Fetch the current state of the given bucket
Callback implementation for ExLimiter.Storage.fetch/1
.
leak_and_consume(bucket, update_fn, boundary_fn, incr) View Source
refresh(bucket, type \\ :soft) View Source
Callback implementation for ExLimiter.Storage.refresh/2
.
update(key, update_fun) View Source
Atomically update the bucket denoted by key
with fun
. Leverage whatever
concurrency controls are available in the given storage mechanism (eg cas for memcached)
Callback implementation for ExLimiter.Storage.update/2
.