ex_limiter v1.3.1 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

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

Consumes n elements from the bucket (atomically)

Callback implementation for ExLimiter.Storage.consume/2.

Callback implementation for ExLimiter.Storage.delete/1.

Fetch the current state of the given bucket

Callback implementation for ExLimiter.Storage.fetch/1.

Link to this function

refresh(bucket, type \\ :soft) View Source

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)

Callback implementation for ExLimiter.Storage.update/2.