Pow v1.0.0-rc.1 Pow.Store.Backend.MnesiaCache View Source
GenServer based key value Mnesia cache store with auto expiration.
When the MnesiaCache starts, it’ll initialize invalidators for all stored
keys using the expire
value. If the expire
datetime is past, it’ll
send call the invalidator immediately.
Initialization options
:nodes
- list of nodes to use. This value defaults to[node()]
.:table_opts
- options to add to table definition. This value defaults to[disc_copies: nodes]
.:timeout
- timeout value in milliseconds for how long to wait until the cache table has initiated. Defaults to 15 seconds.
Configuration options
:ttl
- integer value in milliseconds for ttl of records (required).:namespace
- string value to use for namespacing keys, defaults to “cache”.
Link to this section Summary
Functions
Callback implementation for Pow.Store.Base.delete/2
Callback implementation for Pow.Store.Base.get/2
Callback implementation for Pow.Store.Base.put/3
Link to this section Functions
Callback implementation for Pow.Store.Base.delete/2
.
get(Pow.Config.t(), binary()) :: any() | :not_found
Callback implementation for Pow.Store.Base.get/2
.
handle_cast({:cache, Pow.Config.t(), binary(), any()}, map()) :: {:noreply, map()}
handle_cast({:delete, Pow.Config.t(), binary()}, map()) :: {:noreply, map()}
handle_info({:invalidate, Pow.Config.t(), binary()}, map()) :: {:noreply, map()}
put(Pow.Config.t(), binary(), any()) :: :ok
Callback implementation for Pow.Store.Base.put/3
.
start_link(Pow.Config.t()) :: GenServer.on_start()