Current section
Files
Jump to
Current section
Files
src/scope/temporal_sdk_scope_pg_sup.erl
-module(temporal_sdk_scope_pg_sup).
-behaviour(supervisor).
% elp:ignore W0012 W0040
-moduledoc false.
-export([
start_link/1
]).
-export([
init/1
]).
-spec start_link(ScopeConfig :: [temporal_sdk_node:scope_config()]) -> supervisor:startlink_ret().
start_link(ScopeConfig) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, [ScopeConfig]).
init([ScopeConfig]) ->
{ok, {#{strategy => one_for_one}, child_spec(ScopeConfig)}}.
child_spec(ScopeConfig) ->
[
#{
id => {temporal_sdk_scope_pg_cluster_sup, Scope},
start => {temporal_sdk_scope_pg_cluster_sup, start_link, [Scope, ShardSize]},
type => supervisor
}
|| {Scope, ShardSize} <- ScopeConfig
].