barrel_vectordb_registry (barrel_vectordb v2.1.2)

View Source

Local name registry for vector stores and their companions.

Names are arbitrary terms (in practice {vstore, NameBin} and friends), so dynamically named ephemeral stores never grow the atom table the way {local, Atom} registration does. Implements the {via, Module, Name} callbacks over a public ETS table; the owner process monitors registered pids and removes dead entries, so a crashed store never leaves a stale registration behind.

Summary

Functions

Start the registry if it is not running. Covers callers that start stores without the barrel_vectordb application (eunit, embedded use); under the application the supervisor owns it.

via callback: register Name to Pid. yes on success, no if the name is taken by a live process.

via callback.

via callback.

via callback: resolve Name to a live pid or undefined.

Functions

ensure()

-spec ensure() -> ok.

Start the registry if it is not running. Covers callers that start stores without the barrel_vectordb application (eunit, embedded use); under the application the supervisor owns it.

handle_call(_, From, Mons)

handle_cast(Msg, Mons)

handle_info(Info, Mons)

init(_)

register_name(Name, Pid)

-spec register_name(term(), pid()) -> yes | no.

via callback: register Name to Pid. yes on success, no if the name is taken by a live process.

send(Name, Msg)

-spec send(term(), term()) -> pid().

via callback.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

unregister_name(Name)

-spec unregister_name(term()) -> ok.

via callback.

whereis_name(Name)

-spec whereis_name(term()) -> pid() | undefined.

via callback: resolve Name to a live pid or undefined.