Copyright © 2009-2010 Marc Worrell
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
cleanup/4 | Cleanup process for the depcache. |
cleanup/8 | |
code_change/3 | |
flush/1 | Flush all keys from the caches. |
flush/2 | Flush the key and all keys depending on the key. |
flush_process_dict/0 | Flush all items memoized in the process dictionary. |
get/2 | Fetch the key from the cache, return the data or an undefined if not found (or not valid). |
get/3 | Fetch the key from the cache, return the data or an undefined if not found (or not valid). |
get_subkey/3 | Fetch the key from the cache, return the data or an undefined if not found (or not valid). |
get_wait/2 | Fetch the key from the cache, when the key does not exist then lock the entry and let the calling process insert the value. |
handle_call/3 | Return the ets tables used by the cache. |
handle_cast/2 | |
handle_info/2 | |
in_process/0 | Check if we use a local process dict cache. |
in_process/1 | Enable or disable the in-process caching using the process dictionary. |
init/1 | Initialize the depcache. |
memo/2 | |
memo/3 | |
memo/4 | |
memo/5 | |
set/3 | Add the key to the depcache, hold it for 3600 seconds and no dependencies. |
set/4 | Add the key to the depcache, hold it for MaxAge seconds and no dependencies. |
set/5 | Add the key to the depcache, hold it for MaxAge seconds and check the dependencies. |
size/1 | Return the total memory size of all stored terms. |
start_link/1 | |
terminate/2 | |
tick/1 | Periodic tick used for incrementing the clock. |
cleanup(Pid, MetaTable, DepsTable, DataTable) -> any()
Cleanup process for the depcache. Periodically checks a batch of depcache items for their validity. Asks the depcache server to delete invalidated items. When the load of the data table is too high then This cleanup process starts to delete random entries. By using a random delete we don't need to keep a LRU list, which is a bit expensive.
cleanup(Pid, MetaTable, DepsTable, DataTable, SlotNr, Now, Mode, Ct) -> any()
code_change(OldVersion, State, Extra) -> any()
flush(Context::#context{}) -> void()
Flush all keys from the caches
flush(Key, Context::#context{}) -> void()
Flush the key and all keys depending on the key
flush_process_dict() -> any()
Flush all items memoized in the process dictionary.
get(Key, Context) -> {ok, Data} | undefined
Fetch the key from the cache, return the data or an undefined if not found (or not valid)
get(Key, SubKey, Context) -> {ok, Data} | undefined
Fetch the key from the cache, return the data or an undefined if not found (or not valid)
get_subkey(Key, SubKey, Context) -> {ok, Data} | undefined
Fetch the key from the cache, return the data or an undefined if not found (or not valid)
get_wait(Key, Context) -> {ok, Data} | undefined
Fetch the key from the cache, when the key does not exist then lock the entry and let the calling process insert the value. All other processes requesting the key will wait till the key is updated and receive the key's new value.
handle_call(X1, From, State) -> any()
Return the ets tables used by the cache
handle_cast(Msg, State) -> any()
handle_info(Msg, State) -> any()
in_process() -> any()
Check if we use a local process dict cache
in_process(X1) -> any()
Enable or disable the in-process caching using the process dictionary
init(SiteProps) -> {ok, State}
Initialize the depcache. Creates ets tables for the deps, meta and data. Spawns garbage collector.
memo(Function, Context) -> any()
memo(Function, MaxAge, Context) -> any()
memo(F, Key, MaxAge, Context) -> any()
memo(F, Key, MaxAge, Dep, Context) -> any()
set(Key, Data, Context) -> void()
Add the key to the depcache, hold it for 3600 seconds and no dependencies
set(Key, Data, MaxAge, Context) -> void()
Add the key to the depcache, hold it for MaxAge seconds and no dependencies
set(Key, Data, MaxAge, Depend, Context) -> void()
Add the key to the depcache, hold it for MaxAge seconds and check the dependencies
size(Context::#context{}) -> int()
Return the total memory size of all stored terms
start_link(SiteProps) -> any()
terminate(Reason, State) -> any()
tick(Context::#context{}) -> none()
Periodic tick used for incrementing the clock
Generated by EDoc, Feb 25 2011, 21:14:41.