barrel_ngram_registry (barrel_ngram v0.7.1)
View SourceLocal name registry for ngram shards.
Corpus and shard names are arbitrary terms ({shard, Corpus}), so a dynamically named shard never grows the atom table the way {local, Atom} registration would. Implements the {via, Module, Name} callbacks over a public ETS table; the owner monitors registered pids and clears dead entries so a crashed shard never leaves a stale registration behind.
Summary
Functions
Start the registry if it is not running. Covers callers that start shards without the barrel_ngram 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
-spec ensure() -> ok.
Start the registry if it is not running. Covers callers that start shards without the barrel_ngram 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.
-spec unregister_name(term()) -> ok.
via callback.
via callback: resolve Name to a live pid or undefined.