Mnemonix v0.8.0 Mnemonix.Application

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

Summary

Functions

Starts a Mnemonix.Application with a default configuration. Invoked by Mnemonix.start/2

Functions

start_link(default)
start_link(Mnemonix.Store.Server.config) ::
  {:ok, Mnemonix.store} |
  {:error, reason :: term}

Starts a Mnemonix.Application with a default configuration. Invoked by Mnemonix.start/2.