Module z_depcache

z_depcache interface file for handing depcache functions from the Zotonic context.

Copyright © 2009-2010 Marc Worrell, 2014 Arjan Scherpenisse

Authors: Marc Worrell (marc@worrell.nl).

Description

z_depcache interface file for handing depcache functions from the Zotonic context.

Function Index

flush/1Flush all keys from the caches.
flush/2Flush the key and all keys depending on the key.
flush_process_dict/0Flush all items memoized in the process dictionary.
get/2Fetch the key from the cache, return the data or an undefined if not found (or not valid).
get/3Fetch the key from the cache, return the data or an undefined if not found (or not valid).
get_subkey/3Fetch the key from the cache, return the data or an undefined if not found (or not valid).
get_wait/2Fetch the key from the cache, when the key does not exist then lock the entry and let the calling process insert the value.
in_process/1Enable or disable the in-process caching using the process dictionary.
in_process_server/1Check if we use a local process dict cache.
memo/2
memo/3
memo/4
memo/5
record_depcache_event/2
set/3Add the key to the depcache, hold it for 3600 seconds and no dependencies.
set/4Add the key to the depcache, hold it for MaxAge seconds and no dependencies.
set/5Add the key to the depcache, hold it for MaxAge seconds and check the dependencies.
size/1Return the total memory size of all stored terms.
start_link/1Start depcache instance based on site configuration.

Function Details

flush/1

flush(Context::#context{}) -> void()

Flush all keys from the caches

flush/2

flush(Key, Context::#context{}) -> void()

Flush the key and all keys depending on the key

flush_process_dict/0

flush_process_dict() -> any()

Flush all items memoized in the process dictionary.

get/2

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/3

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/3

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/2

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.

in_process/1

in_process(Flag) -> any()

Enable or disable the in-process caching using the process dictionary

in_process_server/1

in_process_server(Server) -> any()

Check if we use a local process dict cache

memo/2

memo(Function, Context) -> any()

memo/3

memo(Function, MaxAge, Context) -> any()

memo/4

memo(F, Key, MaxAge, Context) -> any()

memo/5

memo(F, Key, MaxAge, Dep, Context) -> any()

record_depcache_event/2

record_depcache_event(Event, Host) -> any()

set/3

set(Key, Data, Context) -> void()

Add the key to the depcache, hold it for 3600 seconds and no dependencies

set/4

set(Key, Data, MaxAge, Context) -> void()

Add the key to the depcache, hold it for MaxAge seconds and no dependencies

set/5

set(Key, Data, MaxAge, Depend, Context) -> void()

Add the key to the depcache, hold it for MaxAge seconds and check the dependencies

size/1

size(Context::#context{}) -> int()

Return the total memory size of all stored terms

start_link/1

start_link(SiteProps) -> any()

Start depcache instance based on site configuration


Generated by EDoc