Mnemonix v0.10.0 Mnemonix.Application View Source

Automatically starts stores when your application starts.

Mnemonix can manage your stores for you. To do so, it looks in your config files for named stores:

config :mnemonix, stores: [:foo, :bar]

For all stores so listed, it will check for store-specific configuration:

config :mnemonix, :foo, {Memonix.ETS.Store, [
  store: [table: :my_ets_table],
  server: []
]}

If no configuration is found for a named store, it will use a default configuration of {Mnemonix.Stores.Map, []}.

The name of the store in your config will be the reference you pass to Mnemonix to interact with it. Given the config above, :foo would refer to an ETS-backed store, and :bar to a default Map-backed store, both available to you at boot time without writing a line of code:

Application.ensure_started(:mnemonix)

Mnemonix.put(:foo, :a, :b)
Mnemonix.get(:foo, :a)
#=> :b

Mnemonix.put(:bar, :a, :b)
Mnemonix.get(:bar, :a)
#=> :b

Link to this section Summary

Types

Default options used by Mnemonix.start/2 to start stores with no specified config

Functions

The default Mnemonix.Application options defined in the project’s mix.exs

Link to this section Types

Default options used by Mnemonix.start/2 to start stores with no specified config.

The default options are [{Mnemonix.Stores.Map, []}].

Link to this section Functions

The default Mnemonix.Application options defined in the project’s mix.exs.