memo v1.0.2 Memo
A memoization library.
Link to this section Summary
Functions
Function memoize return value
from module
, function
and args
,
Link to this section Functions
Link to this function
memoize(module, func, args, opts \\ [])
Function memoize return value
from module
, function
and args
,
Options
:cache
- Cache module implementedMemo.Behaviour
eg.Memo.BaseCache
:ttl
- time to live in seconds
Examples
Before use Memo.BaseCache
you must start it with Memo.BaseCache.start_link/1
.
iex> Memo.memoize(Kernel, :div, [5, 2], cache: Memo.BaseCache)
2