ttl_cache v0.1.0 TTLCache.Server
Link to this section Summary
Functions
Remove the key from the given cache
List all of the entries in the cache
Returns the value associated with the key key for the cache identified by pid
Modelled after Agent.get_and_update. Performs an atomic read-write operation. The special
value of :TTLCache_delete can be returned by fun to atomically instead delete the value
Returns whether or not the key is in the cache
List all of the keys in the cache
Adds value to the cache identified by pid under the key key. The value
will expire based on the TTL provided in TTLCache.Server.start_link/2
Creates a new server process
Stop the cache process
Updates the value associated with the key key for the cache identified by pid with
the given fun. fun will run on the server process and will block the server until
it returns. The TTL will not be refreshed. The special value of :TTLCache_delete can be
returned by fun to atomically instead delete the value
List all of the values in the cache
Link to this section Functions
Remove the key from the given cache
List all of the entries in the cache
Returns the value associated with the key key for the cache identified by pid
Modelled after Agent.get_and_update. Performs an atomic read-write operation. The special
value of :TTLCache_delete can be returned by fun to atomically instead delete the value
Returns whether or not the key is in the cache
List all of the keys in the cache
Adds value to the cache identified by pid under the key key. The value
will expire based on the TTL provided in TTLCache.Server.start_link/2
Creates a new server process.
Accepts the following options:
:ttl- whenever a value is added to the cache viaput/3it will expire based on this value (in milliseconds).:on_expire- a callback that is triggered when an entry expires:refresh_strategy- defines how to handle refreshing a key’s ttl:expiration_strategy- defines how to expire keys
Stop the cache process
Updates the value associated with the key key for the cache identified by pid with
the given fun. fun will run on the server process and will block the server until
it returns. The TTL will not be refreshed. The special value of :TTLCache_delete can be
returned by fun to atomically instead delete the value
List all of the values in the cache