barrel_ngram_shard_sup (barrel_ngram v0.7.1)
View SourceDynamic supervisor for ngram shard processes.
simple_one_for_one: one child per corpus shard. M1 runs a single shard per corpus; the sharding milestone fans a corpus over several shard children without changing this supervisor.
Summary
Functions
Start a shard by ref. Returns the existing shard if one is already running for that ref.
Stop the shard for a ref.
Functions
-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
-spec start_shard(barrel_ngram_shards:ref(), map()) -> {ok, pid()} | {error, term()}.
Start a shard by ref. Returns the existing shard if one is already running for that ref.
-spec stop_shard(barrel_ngram_shards:ref()) -> ok | {error, not_found}.
Stop the shard for a ref.