barrel_design_dbs (barrel_design v0.1.0)

View Source

Registry of the per-database processes.

Owns the public table readers use to find a database's store and indexers. Every discover_ms it looks at the open databases and starts a process for each one with a catalog entry, a publication record or a directory left under the root. Views therefore follow their databases after a restart, and a database receiving its first design is followed, without anyone querying them. A database seen without any of these is checked again on every poll; one whose process failed waits before the next try.

Summary

Functions

The process for Db, started if needed. Mode install keeps it running when the database has no design yet.

What the database's process published: its store, instance, indexers and designs.

Functions

ensure(Db, Mode)

-spec ensure(binary(), install | restore) -> {ok, pid()} | {error, term()}.

The process for Db, started if needed. Mode install keeps it running when the database has no design yet.

handle_call(_, From, S)

handle_cast(Msg, S)

handle_info(Info, S)

init(_)

lookup(Db)

-spec lookup(binary()) -> {ok, map()} | {error, not_found}.

What the database's process published: its store, instance, indexers and designs.

start_link()

stop(Db)

-spec stop(binary()) -> ok.

terminate(Reason, _)