barrel_ngram_shard_sup (barrel_ngram v0.7.1)

View Source

Dynamic 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

init(_)

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

start_link()

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

start_shard(Ref, Config)

-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.

stop_shard(Ref)

-spec stop_shard(barrel_ngram_shards:ref()) -> ok | {error, not_found}.

Stop the shard for a ref.