barrel_ngram_corpus_lifecycle_sup (barrel_ngram v0.9.0)

View Source

Dynamic supervisor for one-shot corpus lifecycle coordinators.

simple_one_for_one: one coordinator per in-flight open/close. restart => temporary -- a coordinator is one-shot by design, it must never be auto-restarted by its own supervisor after its init/1/handle_continue/2 returns {stop, {shutdown, _}} or crashes.

Supervised (not a raw, unlinked gen_server:start/4) specifically so a barrel_ngram_registry crash can forcibly clear any orphaned coordinator via ordinary OTP supervision -- see barrel_ngram_sup's rest_for_one ordering.

Summary

Functions

init(_)

-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.

start_link()

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