Altex.Repo.Gateway (Altex.Repo v0.1.1) View Source

Link to this section Summary

Functions

The Gateway offers an API to load_table(name) and store_table(name, key, value).

Drop the given store. Mostly used for testing.

Load the named table store and return a map of the format %{ uuid => entity, uuid => entity, ... } of the loaded entities.

Start a singelton GenServer, registered as :repo_gateway with an empty list of loaded tables.

Store the given entity at the given uuid in table store.

Link to this section Functions

The Gateway offers an API to load_table(name) and store_table(name, key, value).

List of loaded tables

The 'state' of the server is the list of loaded table-names (as atoms). Accessing a table will ensure the table is loaded but will not reload it if it is in the list of loaded tables already.

The server is started and registered by the name :repo_gateway. You may use another gateway in your application. Therefore, just implement a module which also registers as :repo_gateway and remove this basic ETS implementation from the Application child list.

See the line @implementation ...... That's the place where you inject the implementation of your choice.

Drop the given store. Mostly used for testing.

Load the named table store and return a map of the format %{ uuid => entity, uuid => entity, ... } of the loaded entities.

Start a singelton GenServer, registered as :repo_gateway with an empty list of loaded tables.

Link to this function

store_table(store, uuid, entity)

View Source

Store the given entity at the given uuid in table store.