% Copyright (c) Camden Dixie O'Brien % SPDX-License-Identifier: AGPL-3.0-only -module(subject_sup). -behaviour(supervisor). -export([start_link/0, init/1, start_subject/1]). start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). init([]) -> SupFlags = #{strategy => simple_one_for_one, intensity => 5, period => 10}, ChildSpec = #{id => subject_server, start => {subject_server, start_link, []}, restart => permanent, shutdown => 5000, type => worker, modules => [subject_server]}, {ok, {SupFlags, [ChildSpec]}}. start_subject(Subject) -> supervisor:start_child(?MODULE, [Subject]).