Pow v1.0.0-rc.0 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

Link to this section Functions

Link to this function delete(config, key) View Source
delete(Pow.Config.t(), binary()) :: :ok

Callback implementation for Pow.Store.Base.delete/2.

Link to this function get(config, key) View Source
get(Pow.Config.t(), binary()) :: any() | :not_found

Callback implementation for Pow.Store.Base.get/2.

Link to this function handle_cast(arg, state) View Source
handle_cast({:cache, Pow.Config.t(), binary(), any()}, map()) ::
  {:noreply, map()}
handle_cast({:delete, Pow.Config.t(), binary()}, map()) :: {:noreply, map()}
Link to this function handle_info(arg, state) View Source
handle_info({:invalidate, Pow.Config.t(), binary()}, map()) ::
  {:noreply, map()}
Link to this function init(config) View Source
init(Pow.Config.t()) :: {:ok, map()}
Link to this function put(config, key, value) View Source
put(Pow.Config.t(), binary(), any()) :: :ok

Callback implementation for Pow.Store.Base.put/3.