ejabberd v17.01.0 Ejabberd.Config.Store

Module used for storing the modules parsed from the configuration file.

Example:

- Store.put(:modules, mod1)
- Store.put(:modules, mod2)

- Store.get(:modules) :: [mod1, mod2]

Be carefoul: when retrieving data you get them in the order inserted into the store, which normally is the reversed order of how the modules are specified inside the configuration file. To resolve this just use a Enum.reverse/1.

Summary

Functions

Gets a value based on the key passed. Returns always a list

Stores a value based on the key. If the key already exists, then it inserts the new element, maintaining all the others. It uses a list for this

Stops the store. It uses Agent.stop underneath, so be aware that exit could be called

Functions

get(key)
get(atom) :: [any]

Gets a value based on the key passed. Returns always a list.

put(key, val)
put(atom, any) :: :ok

Stores a value based on the key. If the key already exists, then it inserts the new element, maintaining all the others. It uses a list for this.

start_link()
stop()
stop() :: :ok

Stops the store. It uses Agent.stop underneath, so be aware that exit could be called.