Copyright © 2009 Mr Buzz, Inc.
Behaviours: gen_server.
Authors: Jacob Perkins.
| cache/3 | Equivalent to cache(Name, Term, Value, 300000). |
| cache/4 | Store Value in cache server, referenced by Term. |
| forget/2 | Remove the Value referenced by Term from the cache server. |
| recall/2 | Lookup the Value referenced by Term from the cache server. |
| recall_apply/4 | Looks up result in cache server. |
| recall_apply/5 | |
| start_link/1 | Equivalent to gen_server:start_link({local, Name}, gen_cache, Name, []). |
cache(Name::atom(), Term::term(), Value::term()) -> Value::term()
Equivalent to cache(Name, Term, Value, 300000).
cache(Name::atom(), Term::term(), Value::term(), Timeout::integer()) -> Value::term()
Store Value in cache server, referenced by Term. Value is stored as a compressed binary. Timeout is how long Value should remain in cache.
forget(Name::atom(), Term::term()) -> ok
Remove the Value referenced by Term from the cache server.
recall(Name::atom(), Term::term()) -> term()
Lookup the Value referenced by Term from the cache server.
recall_apply(Name::atom(), Module::atom(), Function::atom(), Args::list()) -> term()
Looks up result in cache server. If no result is found, calls apply. Use this function to simplify the recall-cache pattern.
recall_apply() -> term()
start_link(Name::atom()) -> {ok, pid()}
Equivalent to gen_server:start_link({local, Name}, gen_cache, Name, []).
Generated by EDoc, Jul 14 2009, 14:06:01.