Cache.ConCache (elixir_cache v0.3.11)
View SourceETS Based cache https://github.com/sasa1977/con_cache
Takes the following options:
:acquire_lock_timeout
(pos_integer/0
) - The default value is5000
.:touch_on_read
(boolean/0
) - The default value isfalse
.:global_ttl
- The default value is1800000
.:ttl_check_interval
- The default value is60000
.:dirty?
(boolean/0
) - Use dirty_put instead of locking to put, enabled by default The default value istrue
.:ets_options
- https://www.erlang.org/doc/man/ets.html#new-2
Summary
Functions
Implements a version of get_or_store that locks locally
so only one process runs store_fun
at a time.
Types
@type opts() :: [ name: atom(), pid: pid(), global_ttl: non_neg_integer() | :infinity, acquire_lock_timeout: pos_integer(), touch_on_read: boolean() | nil, ttl_check_interval: non_neg_integer() | false, ets_options: [ets_option()] ]
Functions
Implements a version of get_or_store that locks locally
so only one process runs store_fun
at a time.
Any other processes that miss cache will wait for the first
caller to finish store_fun
then will read the result from cache.