View Source MnesiaStore.Resource (mnesia_store v1.0.0)

The simplest way to use MnesiaStore is to declare a Resource

Examples

defmodule Session do
  use MnesiaStore.Resource
end

Don't forget to put it to your application supervisor

children = [
  Session
]

It will ensure that the corresonding table is created on all the nodes and a special cleaner process is started to evict expired records.

Summary

Functions

Link to this function

calc_expires_at(minutes)

View Source
@spec calc_expires_at(term()) :: timeout()
Link to this function

child_specs(mod, expires_in)

View Source
@spec child_specs(module(), term()) :: [Supervisor.module_spec()]