Database.Worker (Eddb v0.8.0)

View Source

Summary

Functions

Returns a specification to start this module under a supervisor.

Find a topic by name in current state. If there is no match in state, try to retrive data from disc. If there is no data on disc, return nil

Find a topic not just locally, but on all nodes. This works as follows

Callback implementation for GenServer.init/1.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_topic_local(state, topic)

Find a topic by name in current state. If there is no match in state, try to retrive data from disc. If there is no data on disc, return nil

get_topics(state, topic)

Find a topic not just locally, but on all nodes. This works as follows:

  1. Get all connected nodes
  2. Get the pid of the equivalent workers on the other nodes
  3. Call the get_topic_local method on the distante nodes
  4. Aggregate the data to a list
  5. Merge the list with local data and drop all nil values

init(init_arg)

Callback implementation for GenServer.init/1.

start_link(arg)